aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLDrawableHelper.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLDrawableHelper.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index b498748fd..0e135d5e0 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -58,6 +58,7 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLFBODrawable;
import javax.media.opengl.GLRunnable;
+import javax.media.opengl.GLSharedContextSetter;
/** Encapsulates the implementation of most of the GLAutoDrawable's
methods to be able to share it between GLAutoDrawable implementations like GLAutoDrawableBase, GLCanvas and GLJPanel. */
@@ -149,8 +150,14 @@ public class GLDrawableHelper {
final GLContext shareWith;
final boolean pending;
if ( null != sharedAutoDrawable ) {
+ final boolean allGLELInitialized;
+ if( sharedAutoDrawable instanceof GLSharedContextSetter ) {
+ allGLELInitialized = ((GLSharedContextSetter)sharedAutoDrawable).areAllGLEventListenerInitialized();
+ } else {
+ allGLELInitialized = true; // we have to assume 'yes'
+ }
shareWith = sharedAutoDrawable.getContext();
- pending = null == shareWith || !shareWith.isCreated();
+ pending = null == shareWith || !shareWith.isCreated() || !allGLELInitialized;
} else {
shareWith = sharedContext;
pending = null != shareWith && !shareWith.isCreated();
@@ -434,6 +441,12 @@ public class GLDrawableHelper {
}
}
+ public final boolean areAllGLEventListenerInitialized() {
+ synchronized(listenersLock) {
+ return 0 == listenersToBeInit.size();
+ }
+ }
+
public final boolean getGLEventListenerInitState(GLEventListener listener) {
synchronized(listenersLock) {
return !listenersToBeInit.contains(listener);