From 97f4ef2763596993bcb8a6b84150c9ec906dde08 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 21 Jan 2014 18:56:32 +0100 Subject: 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. --- .../classes/javax/media/opengl/GLSharedContextSetter.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java') 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 @@ -98,6 +98,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}. *

@@ -130,8 +136,12 @@ public interface GLSharedContextSetter extends GLAutoDrawable { *

*

* A set sharedAutoDrawable will block context creation, i.e. {@link GLAutoDrawable#initialization GLAutoDrawable initialization}, - * as long it's {@link GLContext} is null - * or has not been {@link GLContext#isCreated() created natively}. + * as long it's + *

*

*

* See Lifecycle Considerations. -- cgit v1.2.3