From 1bfa7a8f6e6dc5999e337aac2b9ddf118cf45a2f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 7 Aug 2011 07:53:46 +0200 Subject: GLProfile / eager init: Use relaxed query, if context was created while initialize shared --- src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 12 +++++------- src/jogl/classes/javax/media/opengl/GLProfile.java | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl') diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index 5fc977581..1340b661d 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -260,19 +260,17 @@ public abstract class GLDrawableFactory { } /** - * Returns true if a shared context is already mapped to the device {@link AbstractGraphicsDevice#getConnection()}, - * or if a new shared context could be created and mapped. Otherwise return false.
- * Creation of the shared context is tried only once. + * Returns true if a shared context could be created while initialization + * of shared resources for device {@link AbstractGraphicsDevice#getConnection()}.
+ * This does not imply a shared context is mapped, but was available
. * * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device. */ - public final boolean getIsSharedContextAvailable(AbstractGraphicsDevice device) { - return null != getOrCreateSharedContext(device); - } + public abstract boolean getWasSharedContextCreated(AbstractGraphicsDevice device); /** * Returns the shared context mapped to the device {@link AbstractGraphicsDevice#getConnection()}, - * either a preexisting or newly created, or null if creation failed or not supported.
+ * either a pre-existing or newly created, or null if creation failed or not supported.
* Creation of the shared context is tried only once. * * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null for the platform's default device. diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 5882046ec..0f502ce32 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -1279,7 +1279,7 @@ public class GLProfile { final boolean addedAnyProfile = addedDesktopProfile || addedEGLProfile ; if(DEBUG) { - System.err.println("GLProfile.init addedAnyProfile(e/d) "+addedAnyProfile+" ("+addedDesktopProfile+"/"+addedEGLProfile+")"); + System.err.println("GLProfile.init addedAnyProfile(d/e) "+addedAnyProfile+" ("+addedDesktopProfile+"/"+addedEGLProfile+")"); System.err.println("GLProfile.init isAWTAvailable "+isAWTAvailable); System.err.println("GLProfile.init hasDesktopGLFactory "+hasDesktopGLFactory); System.err.println("GLProfile.init hasGL234Impl "+hasGL234Impl); @@ -1333,7 +1333,7 @@ public class GLProfile { // Triggers eager initialization of share context in GLDrawableFactory for the device, // hence querying all available GLProfiles - boolean desktopSharedCtxAvail = desktopFactory.getIsSharedContextAvailable(device); + boolean desktopSharedCtxAvail = desktopFactory.getWasSharedContextCreated(device); if (DEBUG) { System.err.println("GLProfile.initProfilesForDevice: "+device+": desktop Shared Ctx "+desktopSharedCtxAvail); } @@ -1352,7 +1352,7 @@ public class GLProfile { // Triggers eager initialization of share context in GLDrawableFactory for the device, // hence querying all available GLProfiles - boolean eglSharedCtxAvail = eglFactory.getIsSharedContextAvailable(device); + boolean eglSharedCtxAvail = eglFactory.getWasSharedContextCreated(device); if (DEBUG) { System.err.println("GLProfile.initProfilesForDevice: "+device+": egl Shared Ctx "+eglSharedCtxAvail); } -- cgit v1.2.3