diff options
Diffstat (limited to 'src/demos/es1/cube/CubeImmModeSink.java')
-rw-r--r-- | src/demos/es1/cube/CubeImmModeSink.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/demos/es1/cube/CubeImmModeSink.java b/src/demos/es1/cube/CubeImmModeSink.java index c7536d2..235d376 100644 --- a/src/demos/es1/cube/CubeImmModeSink.java +++ b/src/demos/es1/cube/CubeImmModeSink.java @@ -43,6 +43,8 @@ import java.nio.*; import com.sun.javafx.newt.*; public class CubeImmModeSink implements GLEventListener { + boolean quit = false; + public CubeImmModeSink () { this(false, false); } @@ -256,6 +258,10 @@ public class CubeImmModeSink implements GLEventListener { // weird effect ..: gl.glCullFace(gl.GL_FRONT); } + public void dispose(GLAutoDrawable drawable) { + quit=true; + } + public void display(GLAutoDrawable drawable) { GLFixedFuncIf gl = GLFixedFuncUtil.getGLFixedFuncIf(drawable.getGL()); GL2ES1 gl2es1=null; @@ -425,12 +431,12 @@ public class CubeImmModeSink implements GLEventListener { long curTime; long startTime = System.currentTimeMillis(); - while (((curTime = System.currentTimeMillis()) - startTime) < 31000) { + while (!quit && ((curTime = System.currentTimeMillis()) - startTime) < 31000) { window.display(); } // Shut things down cooperatively - window.close(); + window.destroy(); window.getFactory().shutdown(); System.out.println("CubeImmModeSink shut down cleanly."); } catch (Throwable t) { |