diff options
Diffstat (limited to 'src/jake2/render/opengl/JoglGL2Driver.java')
-rw-r--r-- | src/jake2/render/opengl/JoglGL2Driver.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/jake2/render/opengl/JoglGL2Driver.java b/src/jake2/render/opengl/JoglGL2Driver.java index ccabf7f..0f91542 100644 --- a/src/jake2/render/opengl/JoglGL2Driver.java +++ b/src/jake2/render/opengl/JoglGL2Driver.java @@ -71,6 +71,7 @@ public abstract class JoglGL2Driver extends JoglGL2ES1 implements GLDriver { } public void shutdown() { + deactivate(); if(null != newtWin) { newtWin.shutdown(); } @@ -102,11 +103,7 @@ public abstract class JoglGL2Driver extends JoglGL2ES1 implements GLDriver { public void endFrame() { newtWin.window.swapBuffers(); - /** - final GLContext ctx = newtWin.window.getContext(); - if ( null != ctx && GLContext.getCurrent() == ctx) { - ctx.release(); - } */ + // deactivate(); newtWin.fpsCounter.tickFPS(); } @@ -136,5 +133,12 @@ public abstract class JoglGL2Driver extends JoglGL2ES1 implements GLDriver { } } + protected void deactivate() { + final GLContext ctx = newtWin.window.getContext(); + if ( null != ctx && GLContext.getCurrent() == ctx) { + ctx.release(); + } + } + // -------------------------------------------------------------------------- } |