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/nativewindow/classes/javax/media | |
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/nativewindow/classes/javax/media')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/Capabilities.java | 15 |
1 files changed, 12 insertions, 3 deletions
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. + * <p> + * <b>Note:</b> If alpha bits are <code>zero</code>, they are set to <code>one</code> + * by {@link #setBackgroundOpaque(boolean)} and it's OpenGL specialization <code>GLCapabilities::setSampleBuffers(boolean)</code>.<br/> + * Ensure to call this method after the above to ensure a <code>zero</code> value.</br> + * The above automated settings takes into account, that the user calls this method to <i>request</i> alpha bits, + * not to <i>reflect</i> a current state. Nevertheless if this is the case - call it at last. + * </p> + */ public void setAlphaBits(int alphaBits) { this.alphaBits = alphaBits; } |