From 4a08de4511a627c3d87d6a33debbd561962c0312 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 20 Jul 2012 14:08:49 +0200 Subject: 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. --- .../classes/javax/media/nativewindow/Capabilities.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/nativewindow/classes') diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java index 196f23598..cb33aec5e 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java +++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java @@ -211,9 +211,18 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable { return alphaBits; } - /** Sets the number of bits requested for the color buffer's alpha - component. On some systems only the color depth, which is the - sum of the red, green, and blue bits, is considered. */ + /** + * Sets the number of bits requested for the color buffer's alpha + * component. On some systems only the color depth, which is the + * sum of the red, green, and blue bits, is considered. + *

+ * Note: If alpha bits are zero, they are set to one + * by {@link #setBackgroundOpaque(boolean)} and it's OpenGL specialization GLCapabilities::setSampleBuffers(boolean).
+ * Ensure to call this method after the above to ensure a zero value.
+ * The above automated settings takes into account, that the user calls this method to request alpha bits, + * not to reflect a current state. Nevertheless if this is the case - call it at last. + *

+ */ public void setAlphaBits(int alphaBits) { this.alphaBits = alphaBits; } -- cgit v1.2.3