From 3ea949b6a14c1ba631cb41b7439af86b21db4c05 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 4 Sep 2011 10:24:42 +0200 Subject: NativeWindow/JOGL: Cleanup Caps doc and implicit related values. Capabilities setBackgroundOpaque -> setAlphaBits GLCapabilities setOnscreen <-> setPBuffer setSampleBuffers -> setAlphaBits --- .../classes/javax/media/opengl/GLCapabilities.java | 52 +++++++++++++--------- 1 file changed, 30 insertions(+), 22 deletions(-) (limited to 'src/jogl/classes') diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilities.java b/src/jogl/classes/javax/media/opengl/GLCapabilities.java index b63124e33..4d9d08827 100644 --- a/src/jogl/classes/javax/media/opengl/GLCapabilities.java +++ b/src/jogl/classes/javax/media/opengl/GLCapabilities.java @@ -211,19 +211,19 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil /** * Enables or disables pbuffer usage.
- * If enabled, onscreen := false. + * If enabled this method also invokes {@link #setOnscreen(int) setOnscreen(false)}
* Defaults to false. */ - public void setPBuffer(boolean onOrOff) { - if(onOrOff) { + public void setPBuffer(boolean enable) { + if(enable) { setOnscreen(false); } - pbuffer = onOrOff; + pbuffer = enable; } /** * Sets whether the drawable surface supports onscreen.
- * If enabled, pbuffer := false.
+ * If enabled this method also invokes {@link #setPBuffer(int) setPBuffer(false)}
* Defaults to true. */ public void setOnscreen(boolean onscreen) { @@ -239,8 +239,8 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil } /** Enables or disables double buffering. */ - public void setDoubleBuffered(boolean onOrOff) { - doubleBuffered = onOrOff; + public void setDoubleBuffered(boolean enable) { + doubleBuffered = enable; } /** Indicates whether stereo is enabled. */ @@ -249,8 +249,8 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil } /** Enables or disables stereo viewing. */ - public void setStereo(boolean onOrOff) { - stereo = onOrOff; + public void setStereo(boolean enable) { + stereo = enable; } /** Indicates whether hardware acceleration is enabled. */ @@ -259,8 +259,8 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil } /** Enables or disables hardware acceleration. */ - public void setHardwareAccelerated(boolean onOrOff) { - hardwareAccelerated = onOrOff; + public void setHardwareAccelerated(boolean enable) { + hardwareAccelerated = enable; } /** Returns the number of bits requested for the depth buffer. */ @@ -347,11 +347,19 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil this.accumAlphaBits = accumAlphaBits; } - /** Indicates whether sample buffers for full-scene antialiasing - (FSAA) should be allocated for this drawable. Defaults to - false. */ - public void setSampleBuffers(boolean onOrOff) { - sampleBuffers = onOrOff; + /** + * Defaults to false.
+ * Indicates whether sample buffers for full-scene antialiasing + * (FSAA) should be allocated for this drawable.
+ * Mind that this requires the alpha component.
+ * If enabled this method also invokes {@link #setAlphaBits(int) setAlphaBits(1)} + * if {@link #getAlphaBits()} == 0.
+ */ + public void setSampleBuffers(boolean enable) { + sampleBuffers = enable; + if(sampleBuffers && getAlphaBits()==0) { + setAlphaBits(1); + } } /** Returns whether sample buffers for full-scene antialiasing @@ -375,8 +383,8 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil /** For pbuffers only, indicates whether floating-point buffers should be used if available. Defaults to false. */ - public void setPbufferFloatingPointBuffers(boolean onOrOff) { - pbufferFloatingPointBuffers = onOrOff; + public void setPbufferFloatingPointBuffers(boolean enable) { + pbufferFloatingPointBuffers = enable; } /** For pbuffers only, returns whether floating-point buffers should @@ -387,8 +395,8 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil /** For pbuffers only, indicates whether the render-to-texture extension should be used if available. Defaults to false. */ - public void setPbufferRenderToTexture(boolean onOrOff) { - pbufferRenderToTexture = onOrOff; + public void setPbufferRenderToTexture(boolean enable) { + pbufferRenderToTexture = enable; } /** For pbuffers only, returns whether the render-to-texture @@ -400,8 +408,8 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil /** For pbuffers only, indicates whether the render-to-texture-rectangle extension should be used if available. Defaults to false. */ - public void setPbufferRenderToTextureRectangle(boolean onOrOff) { - pbufferRenderToTextureRectangle = onOrOff; + public void setPbufferRenderToTextureRectangle(boolean enable) { + pbufferRenderToTextureRectangle = enable; } /** For pbuffers only, returns whether the render-to-texture -- cgit v1.2.3