aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/impl/x11/glx
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-05-11 04:35:34 +0200
committerSven Gothel <[email protected]>2010-05-11 04:35:34 +0200
commit3ab87cbbad28b9f90bb83981aab73ccf478dc929 (patch)
tree3de32576eede37cba59b4ccce4814d0cd7781683 /src/jogl/classes/com/jogamp/opengl/impl/x11/glx
parent6798fc1fb008eff4179f64775a7bf33cfbfd1981 (diff)
Missing comment for last commit 6798fc1fb008eff4179f64775a7bf33cfbfd1981:
- zip Javadocs, moved to build* dir - re-enable WGL ARB GetContext (buggy) - relaxed junit tests: src/junit/com/jogamp/test/junit/jogl/awt/TestAWT01GLn.java - GL3bc/GL4bc + AWT doesn't work with ATI currently, driver bug src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java - All test cases, ie pbuffer detection may fail, no pixmap detection - Fix Windows ARG CreateContext - GLContext - GLVersion mapping functions: use profile bit - Fix isGL*() queries { compat|core, ..} - Pass through the profile bit (COMPAT, CORE, ES), only one can be set - GLProfile - glAvailabilityToString() add the queried HW Context info -
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/x11/glx')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
index cdb7931d1..9c3efea2e 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
@@ -148,6 +148,9 @@ public abstract class X11GLXContext extends GLContextImpl {
long _context=0;
+ final int idx_flags = 6;
+ final int idx_profile = 8;
+
int attribs[] = {
/* 0 */ GLX.GLX_CONTEXT_MAJOR_VERSION_ARB, major,
/* 2 */ GLX.GLX_CONTEXT_MINOR_VERSION_ARB, minor,
@@ -159,20 +162,20 @@ public abstract class X11GLXContext extends GLContextImpl {
if ( major > 3 || major == 3 && minor >= 2 ) {
// FIXME: Verify with a None drawable binding (default framebuffer)
- attribs[8+0] = GLX.GLX_CONTEXT_PROFILE_MASK_ARB;
+ attribs[idx_profile+0] = GLX.GLX_CONTEXT_PROFILE_MASK_ARB;
if( ctBwdCompat ) {
- attribs[8+1] = GLX.GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
+ attribs[idx_profile+1] = GLX.GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
} else {
- attribs[8+1] = GLX.GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
+ attribs[idx_profile+1] = GLX.GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
}
}
if ( major >= 3 ) {
if( !ctBwdCompat && ctFwdCompat ) {
- attribs[6+1] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
+ attribs[idx_flags+1] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
}
if( ctDebug) {
- attribs[6+1] |= GLX.GLX_CONTEXT_DEBUG_BIT_ARB;
+ attribs[idx_flags+1] |= GLX.GLX_CONTEXT_DEBUG_BIT_ARB;
}
}
@@ -180,21 +183,20 @@ public abstract class X11GLXContext extends GLContextImpl {
_context = glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs, 0);
} catch (RuntimeException re) {
if(DEBUG) {
- System.err.println("X11GLXContext.createContextARB glXCreateContextAttribsARB failed: "+re+", with "+getGLVersion(null, major, minor, ctp, "@creation"));
+ System.err.println("X11GLXContext.createContextARB glXCreateContextAttribsARB failed: "+re+", with "+getGLVersion(major, minor, ctp, "@creation"));
re.printStackTrace();
}
}
- if(0==_context) {
- if(DEBUG) {
- System.err.println("X11GLXContext.createContextARB couldn't create "+getGLVersion(null, major, minor, ctp, "@creation"));
- }
- } else {
+ if(DEBUG) {
+ System.err.println("X11GLXContext.createContextARB success: "+(0!=_context)+" - "+getGLVersion(major, minor, ctp, "@creation")+", bwdCompat "+ctBwdCompat+", fwdCompat "+ctFwdCompat);
+ }
+ if(0!=_context) {
if (!glXMakeContextCurrent(display,
drawable.getNativeWindow().getSurfaceHandle(),
drawableRead.getNativeWindow().getSurfaceHandle(),
_context)) {
if(DEBUG) {
- System.err.println("X11GLXContext.createContextARB couldn't make current "+getGLVersion(null, major, minor, ctp, "@creation"));
+ System.err.println("X11GLXContext.createContextARB couldn't make current "+getGLVersion(major, minor, ctp, "@creation"));
}
glXMakeContextCurrent(display, 0, 0, 0);
GLX.glXDestroyContext(display, _context);
@@ -312,10 +314,10 @@ public abstract class X11GLXContext extends GLContextImpl {
if(glp.isGL3()) {
glXMakeContextCurrent(display, 0, 0, 0);
GLX.glXDestroyContext(display, temp_context);
- throw new GLException("X11GLXContext.createContext failed, but context > GL2 requested "+getGLVersion(null, major[0], minor[0], ctp[0], "@creation")+", ");
+ throw new GLException("X11GLXContext.createContext failed, but context > GL2 requested "+getGLVersion(major[0], minor[0], ctp[0], "@creation")+", ");
}
if(DEBUG) {
- System.err.println("X11GLXContext.createContext failed, fall back to !ARB context "+getGLVersion(null, major[0], minor[0], ctp[0], "@creation"));
+ System.err.println("X11GLXContext.createContext failed, fall back to !ARB context "+getGLVersion(major[0], minor[0], ctp[0], "@creation"));
}
// continue with temp context for GL <= 3.0