aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/render/opengl/JoglES1Driver.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-16 15:40:28 +0200
committerSven Gothel <[email protected]>2012-10-16 15:40:28 +0200
commit0e0ab268b810371828f23d9e5f6be46a3c8a081f (patch)
treefdc460e20530271a1d4107ef1c36ebe84fe91c27 /src/jake2/render/opengl/JoglES1Driver.java
parentf453507d789394f3dc60c4fa97d87d91cfc4b1e1 (diff)
Jogl*Driver.shutdown(): Release hold ctx before killing window offthread (required since we don't release ctx after each frame)
Diffstat (limited to 'src/jake2/render/opengl/JoglES1Driver.java')
-rw-r--r--src/jake2/render/opengl/JoglES1Driver.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/jake2/render/opengl/JoglES1Driver.java b/src/jake2/render/opengl/JoglES1Driver.java
index afb1c12..b1d882d 100644
--- a/src/jake2/render/opengl/JoglES1Driver.java
+++ b/src/jake2/render/opengl/JoglES1Driver.java
@@ -72,6 +72,7 @@ public abstract class JoglES1Driver extends JoglGL2ES1 implements GLDriver {
}
public void shutdown() {
+ deactivate();
if(null != newtWin) {
newtWin.shutdown();
}
@@ -103,11 +104,7 @@ public abstract class JoglES1Driver 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,6 +133,13 @@ public abstract class JoglES1Driver extends JoglGL2ES1 implements GLDriver {
ctx.makeCurrent();
}
}
-
+
+ protected void deactivate() {
+ final GLContext ctx = newtWin.window.getContext();
+ if ( null != ctx && GLContext.getCurrent() == ctx) {
+ ctx.release();
+ }
+ }
+
// --------------------------------------------------------------------------
}