From c3098619080d10e5bec8b52999117002b16f3ff5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 25 Feb 2012 18:30:25 +0100 Subject: X11/GLX: Query X Server whether GLX is available (X11/SharedResourceRunner) ; Minor cleanups. Before gathering GLX details and actually instantiate a X11/GLX shared resource, we shall query whether GLX is actually available. Since GLX availability is being queried on the server side, more changes are required for the X11GLX* impl, eg. not using X11GLXGraphicsConfigurationFactory and fall back to X11GraphicsConfigurationFactory. --- src/jogl/classes/javax/media/opengl/GLProfile.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl/GLProfile.java') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 83e8e0bbf..4d4b0d82c 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -1519,10 +1519,10 @@ public class GLProfile { boolean addedDesktopProfile = false; boolean addedEGLProfile = false; - boolean deviceIsDesktopCompatible = false; - boolean deviceIsEGLCompatible = false; - if( hasDesktopGLFactory && ( deviceIsDesktopCompatible = desktopFactory.getIsDeviceCompatible(device)) ) { + final boolean deviceIsDesktopCompatible = hasDesktopGLFactory && desktopFactory.getIsDeviceCompatible(device); + + if( deviceIsDesktopCompatible ) { // 1st pretend we have all Desktop and EGL profiles .. computeProfileMap(device, true /* desktopCtxUndef*/, true /* esCtxUndef */); @@ -1536,22 +1536,21 @@ public class GLProfile { if(null != sharedResourceThread) { initLock.removeOwner(sharedResourceThread); } - if(!desktopSharedCtxAvail) { - hasDesktopGLFactory = false; - } if (DEBUG) { System.err.println("GLProfile.initProfilesForDevice: "+device+": desktop Shared Ctx "+desktopSharedCtxAvail); } - if( hasDesktopGLFactory && !GLContext.getAvailableGLVersionsSet(device) ) { + if(!desktopSharedCtxAvail) { + hasDesktopGLFactory = false; + } else if( !GLContext.getAvailableGLVersionsSet(device) ) { throw new InternalError("Available GLVersions not set"); } addedDesktopProfile = computeProfileMap(device, false /* desktopCtxUndef*/, false /* esCtxUndef */); } + final boolean deviceIsEGLCompatible = hasEGLFactory && eglFactory.getIsDeviceCompatible(device); + // also test GLES1 and GLES2 on desktop, since we have implementations / emulations available - if( hasEGLFactory && ( hasGLES2Impl || hasGLES1Impl ) && - ( deviceIsEGLCompatible = eglFactory.getIsDeviceCompatible(device)) ) { - + if( deviceIsEGLCompatible && ( hasGLES2Impl || hasGLES1Impl ) ) { // 1st pretend we have all EGL profiles .. computeProfileMap(device, false /* desktopCtxUndef*/, true /* esCtxUndef */); -- cgit v1.2.3