diff options
author | Sven Gothel <[email protected]> | 2012-07-20 14:08:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-07-20 14:08:49 +0200 |
commit | 4a08de4511a627c3d87d6a33debbd561962c0312 (patch) | |
tree | 68576036b13d49ddb73855444bbb1a0fb25ba54b /src/jogl/classes/jogamp/opengl/macosx/cgl | |
parent | 2da0d69fec6209c55832f5aae9d365e25d3aba6d (diff) |
GLCapabilities Native Aquisition: Set alpha bits at last - due to it's auto setting by setSampleBuffers(true) and setBackgroundOpaque(false)
This bug lead to X11 GLCapabilities rgba: 8/8/8/1 - which ofc is invalid. Sideeffect was a bad selected GLXFB configuration
and the GLContext couldn't be made current.
Patch sets alpha bits reflecting reality carefully after opaque/samples. Added API doc note.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/macosx/cgl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java index 421e1ef96..202644bb3 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java @@ -281,6 +281,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration glp = GLProfile.get(GLProfile.GL2); } GLCapabilities caps = new GLCapabilities(glp); + int alphaBits = 0; for (int i = 0; i < len; i++) { int attr = cglInternalAttributeToken[i+off]; switch (attr) { @@ -317,7 +318,8 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration break; case CGL.NSOpenGLPFAAlphaSize: - caps.setAlphaBits(ivalues[i]); + // ALPHA shall be set at last - due to it's auto setting by !opaque / samples + alphaBits = ivalues[i]; break; case CGL.NSOpenGLPFADepthSize: @@ -350,6 +352,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration break; } } + caps.setAlphaBits(alphaBits); return caps; } |