Attempt at fixing window and bgfx reinit
This commit is contained in:
parent
ec1dcb734a
commit
92aa012738
2 changed files with 12 additions and 3 deletions
|
@ -21,6 +21,7 @@ package de.staropensource.engine.rendering.renderer;
|
||||||
|
|
||||||
import de.staropensource.engine.base.utility.misc.Miscellaneous;
|
import de.staropensource.engine.base.utility.misc.Miscellaneous;
|
||||||
import de.staropensource.engine.base.utility.misc.NumberUtil;
|
import de.staropensource.engine.base.utility.misc.NumberUtil;
|
||||||
|
import de.staropensource.engine.rendering.RenderingSubsystem;
|
||||||
import de.staropensource.engine.rendering.RenderingSubsystemConfiguration;
|
import de.staropensource.engine.rendering.RenderingSubsystemConfiguration;
|
||||||
import de.staropensource.engine.rendering.exception.NotOnMainThreadException;
|
import de.staropensource.engine.rendering.exception.NotOnMainThreadException;
|
||||||
import de.staropensource.engine.rendering.type.FrameHandler;
|
import de.staropensource.engine.rendering.type.FrameHandler;
|
||||||
|
@ -343,6 +344,7 @@ public final class Renderer {
|
||||||
@SuppressWarnings({ "InfiniteLoopStatement" })
|
@SuppressWarnings({ "InfiniteLoopStatement" })
|
||||||
private static void render() {
|
private static void render() {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
RenderingCode.updateWindowStates();
|
||||||
RenderingCode.resetFrame();
|
RenderingCode.resetFrame();
|
||||||
RenderingCode.invokeFrameHandlers();
|
RenderingCode.invokeFrameHandlers();
|
||||||
RenderingCode.renderWindows();
|
RenderingCode.renderWindows();
|
||||||
|
|
|
@ -103,6 +103,15 @@ final class RenderingCode {
|
||||||
private static long timesPSO = System.currentTimeMillis() + 1000;
|
private static long timesPSO = System.currentTimeMillis() + 1000;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the states of all windows.
|
||||||
|
*
|
||||||
|
* @since v1-alpha0
|
||||||
|
*/
|
||||||
|
public static void updateWindowStates() {
|
||||||
|
for (Window window : Window.getWindows())
|
||||||
|
window.updateState();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Resets all frame data.
|
* Resets all frame data.
|
||||||
*
|
*
|
||||||
|
@ -137,10 +146,8 @@ final class RenderingCode {
|
||||||
|
|
||||||
// Render all windows
|
// Render all windows
|
||||||
for (Window window : Window.getWindows())
|
for (Window window : Window.getWindows())
|
||||||
if (window.isRendering()) {
|
if (window.isRendering())
|
||||||
window.updateState();
|
|
||||||
window.render();
|
window.render();
|
||||||
}
|
|
||||||
|
|
||||||
// Advance to next frame
|
// Advance to next frame
|
||||||
bgfx_frame(false);
|
bgfx_frame(false);
|
||||||
|
|
Loading…
Reference in a new issue