summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/windows
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/windows
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/windows')
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
index ebe202f31..217d88f3c 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -296,12 +296,13 @@ public class WindowsWGLContext extends GLContextImpl {
throw new GLException("Error making temp context current: 0x" + toHexString(temp_ctx) + ", werr: "+GDI.GetLastError());
}
setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT); // use GL_VERSION
- boolean isCreateContextAttribsARBAvailable = isFunctionAvailable("wglCreateContextAttribsARB");
WGL.wglMakeCurrent(0, 0); // release temp context
if( !createContextARBTried) {
- if(isCreateContextAttribsARBAvailable &&
- isExtensionAvailable("WGL_ARB_create_context") ) {
+ // is*Available calls are valid since setGLFunctionAvailability(..) was called
+ final boolean isProcCreateContextAttribsARBAvailable = isFunctionAvailable("wglCreateContextAttribsARB");
+ final boolean isExtARBCreateContextAvailable = isExtensionAvailable("WGL_ARB_create_context");
+ if ( isProcCreateContextAttribsARBAvailable && isExtARBCreateContextAvailable ) {
// initial ARB context creation
contextHandle = createContextARB(share, true);
createContextARBTried=true;
@@ -313,7 +314,8 @@ public class WindowsWGLContext 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);
}
}
}