diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
3 files changed, 22 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java index 0d56bcde1..c37bcee50 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java @@ -146,6 +146,13 @@ public class X11GLXContext extends GLContextImpl { isGLXVersionGreaterEqualOneThree = null != glXServerVersion ? glXServerVersion.compareTo(X11GLXDrawableFactory.versionOneThree) >= 0 : false; return isGLXVersionGreaterEqualOneThree; } + protected final void forceGLXVersionOneOne() { + glXServerVersion = X11GLXDrawableFactory.versionOneOne; + isGLXVersionGreaterEqualOneThree = false; + if(DEBUG) { + System.err.println("X11GLXContext.forceGLXVersionNumber: "+glXServerVersion); + } + } @Override public final boolean isGLReadDrawableAvailable() { @@ -300,8 +307,9 @@ public class X11GLXContext extends GLContextImpl { final GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities(); final GLProfile glp = glCaps.getGLProfile(); - if( config.getFBConfigID() < 0 ) { - // not able to use FBConfig + if( !config.hasFBConfig() ) { + // not able to use FBConfig -> GLX 1.1 + forceGLXVersionOneOne(); if(glp.isGL3()) { throw new GLException(getThreadName()+": Unable to create OpenGL >= 3.1 context"); } diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index e44be7509..394293bc0 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -262,7 +262,6 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { GLXUtil.initGLXClientDataSingleton(sharedDevice); final String glXServerVendorName = GLX.glXQueryServerString(sharedDevice.getHandle(), 0, GLX.GLX_VENDOR); - final VersionNumber glXServerVersion = GLXUtil.getGLXServerVersionNumber(sharedDevice); final boolean glXServerMultisampleAvailable = GLXUtil.isMultisampleAvailable(GLX.glXQueryServerString(sharedDevice.getHandle(), 0, GLX.GLX_EXTENSIONS)); final GLProfile glp = GLProfile.get(sharedDevice, GLProfile.GL_PROFILE_LIST_MIN_DESKTOP, false); @@ -273,7 +272,14 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { final GLCapabilitiesImmutable caps = new GLCapabilities(glp); final GLDrawableImpl sharedDrawable = createOnscreenDrawableImpl(createDummySurfaceImpl(sharedDevice, false, caps, caps, null, 64, 64)); sharedDrawable.setRealized(true); - + final X11GLCapabilities chosenCaps = (X11GLCapabilities) sharedDrawable.getChosenGLCapabilities(); + final boolean glxForcedOneOne = !chosenCaps.hasFBConfig(); + final VersionNumber glXServerVersion; + if( glxForcedOneOne ) { + glXServerVersion = versionOneOne; + } else { + glXServerVersion = GLXUtil.getGLXServerVersionNumber(sharedDevice); + } final GLContextImpl sharedContext = (GLContextImpl) sharedDrawable.createContext(null); if (null == sharedContext) { throw new GLException("Couldn't create shared context for drawable: "+sharedDrawable); @@ -294,7 +300,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { System.err.println("SharedScreen: " + sharedScreen); System.err.println("SharedContext: " + sharedContext + ", madeCurrent " + madeCurrent); System.err.println("GLX Server Vendor: " + glXServerVendorName); - System.err.println("GLX Server Version: " + glXServerVersion); + System.err.println("GLX Server Version: " + glXServerVersion + ", forced "+glxForcedOneOne); System.err.println("GLX Server Multisample: " + glXServerMultisampleAvailable); System.err.println("GLX Client Vendor: " + GLXUtil.getClientVendorName()); System.err.println("GLX Client Version: " + GLXUtil.getClientVersionNumber()); diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java index 523364389..c23bd5337 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java @@ -79,6 +79,9 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem public final int getFBConfigID() { return ((X11GLCapabilities)capabilitiesChosen).getFBConfigID(); } + public final boolean hasFBConfig() { + return ((X11GLCapabilities)capabilitiesChosen).hasFBConfig(); + } void updateGraphicsConfiguration() { final CapabilitiesImmutable aChosenCaps = getChosenCapabilities(); |