summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLContextImpl.java
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/GLContextImpl.java
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/GLContextImpl.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 49b90008b..af8282752 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -542,12 +542,16 @@ public abstract class GLContextImpl extends GLContext {
reqMajor = ctxMajorVersion;
reqProfile = GLContext.CTX_PROFILE_ES;
} else {
- // Only GL2 actually
- if(ctxMajorVersion>2 || 0 != ( ctxOptions & GLContext.CTX_PROFILE_CORE)) {
- throw new InternalError("XXX: "+getGLVersion());
+ if(ctxMajorVersion<3 || ctxMajorVersion==3 && ctxMinorVersion==0) {
+ reqMajor = 2;
+ } else {
+ reqMajor = ctxMajorVersion;
+ }
+ if( 0 != ( ctxOptions & GLContext.CTX_PROFILE_CORE) ) {
+ reqProfile = GLContext.CTX_PROFILE_CORE;
+ } else {
+ reqProfile = GLContext.CTX_PROFILE_COMPAT;
}
- reqMajor = 2;
- reqProfile = GLContext.CTX_PROFILE_COMPAT;
}
GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile,
ctxMajorVersion, ctxMinorVersion, ctxOptions);
@@ -1137,18 +1141,17 @@ public abstract class GLContextImpl extends GLContext {
public final boolean isFunctionAvailable(String glFunctionName) {
// Check GL 1st (cached)
- ProcAddressTable pTable = getGLProcAddressTable(); // null if ctx not created once
- if(null!=pTable) {
+ if(null!=glProcAddressTable) { // null if this context wasn't not created
try {
- if(0!=pTable.getAddressFor(glFunctionName)) {
+ if(0!=glProcAddressTable.getAddressFor(glFunctionName)) {
return true;
}
} catch (Exception e) {}
}
- // Check platform extensions 2nd (cached) - had to be enabled once
- pTable = getPlatformExtProcAddressTable(); // null if ctx not created once
- if(null!=pTable) {
+ // Check platform extensions 2nd (cached) - context had to be enabled once
+ final ProcAddressTable pTable = getPlatformExtProcAddressTable();
+ if(null!=pTable) {
try {
if(0!=pTable.getAddressFor(glFunctionName)) {
return true;