aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-12-22 01:16:12 +0100
committerSven Gothel <[email protected]>2011-12-22 01:16:12 +0100
commitd225d0a8a16e362ddb14cb93c124eb06cf0ff05e (patch)
tree3570752984cf05edd889e72760ae52023b1f10c6 /src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
parent044bf81567f0cb809a5e42094c98e1306867d625 (diff)
GLJPanel: Fix dispose of backend (J2DOGL thread, no double dispose)..,
GLJPanel: - fix dispose of backend - proper J2DOGL thread - no double dispose - remove VERBOSE - no dispose regenerate flag - add @Overrride - more safe createContext(..) impl - setSynchronized(true); for all backends - ensure AbstractGraphicsDevice close() is being called GLDrawableHelper: - Clarify w/ isDisposeAction = null==initAction GLPbufferImpl: - ensure AbstractGraphicsDevice close() is being called Java2D: - remove VERBOSE -
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLDrawableHelper.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableHelper.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index 1453a853c..41b4ea878 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -348,11 +348,10 @@ public class GLDrawableHelper {
return;
}
- if(null==initAction) {
- // disposal case
- if(!context.isCreated()) {
- throw new GLException(Thread.currentThread().getName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context is not created: "+context);
- }
+ final boolean isDisposeAction = null==initAction ;
+
+ if( isDisposeAction && !context.isCreated() ) {
+ throw new GLException(Thread.currentThread().getName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context is not created: "+context);
}
// Support for recursive makeCurrent() calls as well as calling
@@ -383,7 +382,7 @@ public class GLDrawableHelper {
res = context.makeCurrent();
}
if (res != GLContext.CONTEXT_NOT_CURRENT) {
- if(null!=initAction) {
+ if(!isDisposeAction) {
perThreadInitAction.set(initAction);
if (res == GLContext.CONTEXT_CURRENT_NEW) {
if (DEBUG) {
@@ -398,12 +397,10 @@ public class GLDrawableHelper {
runnable.run();
// td2 = System.currentTimeMillis();
// tdR = td2 - tdR; // render time
- if (autoSwapBufferMode && null != initAction) {
- if (drawable != null) {
+ if (autoSwapBufferMode && !isDisposeAction && drawable != null) {
drawable.swapBuffers();
// td3 = System.currentTimeMillis();
// td2 = td3 - td2; // swapBuffers
- }
}
}
}