add code to exit from code

This commit is contained in:
yugecin
2017-01-18 16:55:30 +01:00
parent b1ccfe3019
commit 02863de1cf
3 changed files with 13 additions and 17 deletions

View File

@@ -93,6 +93,8 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
public int renderDelta;
public int delta;
public boolean exitRequested;
public int timeSinceLastRender;
private long lastFrame;
@@ -153,7 +155,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
public void run() throws LWJGLException {
while(!(Display.isCloseRequested() && state.onCloseRequest())) {
while(!exitRequested && !(Display.isCloseRequested() && state.onCloseRequest())) {
delta = getDelta();
timeSinceLastRender += delta;
@@ -196,7 +198,6 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
Display.processMessages();
Display.sync(targetUpdatesPerSecond);
}
teardown();
}
public void setup() throws Exception {