aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/windows
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-07-20 14:08:49 +0200
committerSven Gothel <[email protected]>2012-07-20 14:08:49 +0200
commit4a08de4511a627c3d87d6a33debbd561962c0312 (patch)
tree68576036b13d49ddb73855444bbb1a0fb25ba54b /src/jogl/classes/jogamp/opengl/windows
parent2da0d69fec6209c55832f5aae9d365e25d3aba6d (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/windows')
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
index e255a0672..6a4ce5a4e 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
@@ -52,10 +52,11 @@ public class WGLGLCapabilities extends GLCapabilities {
public boolean setValuesByGDI() {
arb_pixelformat = -1;
+ // ALPHA shall be set at last - due to it's auto setting by !opaque / samples
setRedBits(pfd.getCRedBits());
setGreenBits(pfd.getCGreenBits());
setBlueBits(pfd.getCBlueBits());
- setAlphaBits(pfd.getCAlphaBits());
+ setAlphaBits(pfd.getCAlphaBits());
setAccumRedBits(pfd.getCAccumRedBits());
setAccumGreenBits(pfd.getCAccumGreenBits());
setAccumBlueBits(pfd.getCAccumBlueBits());
@@ -77,6 +78,7 @@ public class WGLGLCapabilities extends GLCapabilities {
public boolean setValuesByARB(final int[] iattribs, final int niattribs, final int[] iresults) {
arb_pixelformat = 1;
+ int alphaBits = 0;
for (int i = 0; i < niattribs; i++) {
int attr = iattribs[i];
switch (attr) {
@@ -143,7 +145,8 @@ public class WGLGLCapabilities extends GLCapabilities {
break;
case WGLExt.WGL_ALPHA_BITS_ARB:
- setAlphaBits(iresults[i]);
+ // ALPHA shall be set at last - due to it's auto setting by !opaque / samples
+ alphaBits = iresults[i];
break;
case WGLExt.WGL_ACCUM_RED_BITS_ARB:
@@ -174,6 +177,7 @@ public class WGLGLCapabilities extends GLCapabilities {
throw new GLException("Unknown pixel format attribute " + iattribs[i]);
}
}
+ setAlphaBits(alphaBits);
return true;
}