aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/x11/glx
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-03-18 22:33:46 +0100
committerSven Gothel <[email protected]>2012-03-18 22:33:46 +0100
commit7a40768455342ab2d1d43bf435baa42a8ccaf917 (patch)
treef5e19ab9ffa6f9edd04a4eed5d52c52437bb33db /src/jogl/classes/jogamp/opengl/x11/glx
parentd570fa74d4fd22459aa1579749a7705949a2a748 (diff)
Fix bug 564 (X11 Mesa 8.0.1 GL 3.0 w/o GLX_ARB_create_context)
X11/Mesa 8.0.1 offers a GL 3.0 context w/o having the GLX_ARB_create_context extension available (even though the func-ptr glXCreateContextAttribsARB is not null). We assumed that if no GLContext device availability is set, it can be only GL 2.0 or ES1/ES2. Fix: Relaxed these (false) constrains and map the created context reflecting using it's actual attributes.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx')
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
index 12bb2a9a6..08e064da5 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -335,12 +335,13 @@ public abstract class X11GLXContext extends GLContextImpl {
throw new GLException("Error making temp context(1) current: display "+toHexString(display)+", context "+toHexString(temp_ctx)+", drawable "+drawable);
}
setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT); // use GL_VERSION
- boolean isCreateContextAttribsARBAvailable = isFunctionAvailable("glXCreateContextAttribsARB");
glXMakeContextCurrent(display, 0, 0, 0); // release temp context
if( !createContextARBTried ) {
- if ( isCreateContextAttribsARBAvailable &&
- isExtensionAvailable("GLX_ARB_create_context") ) {
+ // is*Available calls are valid since setGLFunctionAvailability(..) was called
+ final boolean isProcCreateContextAttribsARBAvailable = isFunctionAvailable("glXCreateContextAttribsARB");
+ final boolean isExtARBCreateContextAvailable = isExtensionAvailable("GLX_ARB_create_context");
+ if ( isProcCreateContextAttribsARBAvailable && isExtARBCreateContextAvailable ) {
// initial ARB context creation
contextHandle = createContextARB(share, direct);
createContextARBTried=true;
@@ -352,7 +353,8 @@ public abstract class X11GLXContext extends GLContextImpl {
}
}
} else if (DEBUG) {
- System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - extension not available - share "+share);
+ System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - extension not available - share "+share+
+ ", isProcCreateContextAttribsARBAvailable "+isProcCreateContextAttribsARBAvailable+", isExtGLXARBCreateContextAvailable "+isExtARBCreateContextAvailable);
}
}
}