aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-01-21 18:56:32 +0100
committerSven Gothel <[email protected]>2014-01-21 18:56:32 +0100
commit97f4ef2763596993bcb8a6b84150c9ec906dde08 (patch)
treecef35d35f7890564508a59ecbde26cfd953cddd1 /src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
parent343deff48d81b0abf58c275d9e0aced12a911802 (diff)
Better shared GLAutoDrawable synchronization: Block slave instances to also block until all master's GLEventListener.init(..) methods have been called
Better shared GLAutoDrawable synchronization. Block slave instances to also block until all master's GLEventListener.init(..) methods have been called - GLSharedContextSetter: Add areAllGLEventListenerInitialized() - GLCanvas (SWT, AWT) - GLJPanel - GLAutoDrawableBase (GLWindow, ..) - GLDrawableHelper's isSharedGLContextPending(..) takes 'areAllGLEventListenerInitialized()' into consideration allowing to block the slave creation until master is completed. This solves teh use case, where the master creates resources in it's GLEventListener initialization (buffers), which are shared with it's slaves.
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java b/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
index 69ee03546..2ea4e4cd6 100644
--- a/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
+++ b/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
@@ -99,6 +99,12 @@ package javax.media.opengl;
*/
public interface GLSharedContextSetter extends GLAutoDrawable {
/**
+ * Returns true if all {@link GLEventListener} are initialized, otherwise false.
+ * @deprecated Promote method to {@link GLAutoDrawable}
+ */
+ boolean areAllGLEventListenerInitialized();
+
+ /**
* Specifies an {@link GLContext OpenGL context}, which shall be shared by this {@link GLAutoDrawable}'s {@link GLContext}.
* <p>
* Since the {@link GLDrawable drawable} and {@link GLContext context} is created
@@ -130,8 +136,12 @@ public interface GLSharedContextSetter extends GLAutoDrawable {
* </p>
* <p>
* A set <i>sharedAutoDrawable</i> will block context creation, i.e. {@link GLAutoDrawable#initialization GLAutoDrawable initialization},
- * as long it's {@link GLContext} is <code>null</code>
- * or has not been {@link GLContext#isCreated() created natively}.
+ * as long it's
+ * <ul>
+ * <li>{@link GLContext} is <code>null</code>, or</li>
+ * <li>{@link GLContext} has not been {@link GLContext#isCreated() created natively}, or</li>
+ * <li>{@link GLEventListener} are <i>not</i> {@link GLSharedContextSetter#areAllGLEventListenerInitialized() completely initialized}</li>
+ * </ul>
* </p>
* <p>
* See <a href="#lifecycle">Lifecycle Considerations</a>.