summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-09-20 16:06:56 +0200
committerSven Gothel <[email protected]>2014-09-20 16:06:56 +0200
commitc68e7f9b56f08341ec4977337e3c07384c3782fb (patch)
tree1d6210686e27e072085a17a74ec1b634b82c6ffb /src/jogl/classes/javax
parentc2cbcf91af97053c4b4683e2d2c5087409edf5c4 (diff)
FBObject: Fix depth- and stencil bit count selection for attachRenderbuffer(..);
- Fix depth- and stencil bit count selection for attachRenderbuffer(..) - Add generic values: DEFAULT_BITS, REQUESTED_BITS, CHOSEN_BITS, MAXIMUM_BITS - Refactor depth- and stencil bit-count -> format into own method - Allow depth- and stencil bit-count select a higher bit-count if required (fix) - GLFBODrawable.FBOMODE_USE_DEPTH is deprecated, using GLCapabilities.[get|set]DepthBits(..) - It was an oversight to introduce the bit flag in the first place, since we should have used the capabilities depth bit-count - Graph Test: GLEventListenerButton shall use requested capabilities for FBO drawable.
Diffstat (limited to 'src/jogl/classes/javax')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLFBODrawable.java17
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java2
2 files changed, 11 insertions, 8 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
index e98e5cbd5..01db60b2e 100644
--- a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
@@ -80,11 +80,14 @@ public interface GLFBODrawable extends GLDrawable {
/** FBO Mode Bit: Use a {@link TextureAttachment} for the {@link #getColorbuffer(int) render colorbuffer} ({@link #FBOMODE_DEFAULT default}), see {@link #setFBOMode(int)}. */
public static final int FBOMODE_USE_TEXTURE = 1 << 0;
- /** FBO Mode Bit: Use a depth renderbuffer ({@link #FBOMODE_DEFAULT default}), see {@link #setFBOMode(int)}. */
+ /**
+ * FBO Mode Bit: Use a depth renderbuffer ({@link #FBOMODE_DEFAULT default}), see {@link #setFBOMode(int)}.
+ * @deprecated Use {@link GLCapabilities#setDepthBits(int)}!
+ */
public static final int FBOMODE_USE_DEPTH = 1 << 1;
- /** FBO Default Mode Bit: {@link #FBOMODE_USE_TEXTURE} | {@link #FBOMODE_USE_DEPTH}. */
- public static final int FBOMODE_DEFAULT = FBOMODE_USE_TEXTURE | FBOMODE_USE_DEPTH;
+ /** FBO Default Mode Bit: {@link #FBOMODE_USE_TEXTURE}. */
+ public static final int FBOMODE_DEFAULT = FBOMODE_USE_TEXTURE;
/**
* @return <code>true</code> if initialized, i.e. a {@link GLContext} is bound and made current once, otherwise <code>false</code>.
@@ -101,8 +104,8 @@ public interface GLFBODrawable extends GLDrawable {
* {@link #FBOMODE_USE_TEXTURE} is always added at initialization.
* </p>
*
- * @param modeBits custom FBO mode bits like {@link #FBOMODE_USE_TEXTURE} and {@link #FBOMODE_USE_DEPTH}.
- * @throws IllegalStateException if the underlying FBO is already {@link #isInitialized()}.
+ * @param modeBits custom FBO mode bits like {@link #FBOMODE_USE_TEXTURE}.
+ * @throws IllegalStateException if already initialized, see {@link #isInitialized()}.
*/
void setFBOMode(final int modeBits) throws IllegalStateException;
@@ -155,9 +158,9 @@ public interface GLFBODrawable extends GLDrawable {
* Must be called before {@link #isInitialized() initialization}, otherwise an exception is thrown.
* </p>
* @return the new number of buffers (FBO) used, maybe different than the requested <code>bufferCount</code> (see above)
- * @throws GLException if already initialized, see {@link #isInitialized()}.
+ * @throws IllegalStateException if already initialized, see {@link #isInitialized()}.
*/
- int setNumBuffers(final int bufferCount) throws GLException;
+ int setNumBuffers(final int bufferCount) throws /* IllegalStateException, */ GLException;
/**
* @return the number of buffers (FBO) being used. 1 if not using {@link GLCapabilities#getDoubleBuffered() double buffering},
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index f079b3d03..ff7e1971f 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -1669,7 +1669,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
final boolean useGLSLFlip_pre = flipVertical && offscreenIsFBO && reqOffscreenCaps.getGLProfile().isGL2ES2() && USE_GLSL_TEXTURE_RASTERIZER;
if( offscreenIsFBO && !useGLSLFlip_pre ) {
// Texture attachment only required for GLSL vertical flip, hence simply use a color-renderbuffer attachment.
- ((GLFBODrawable)offscreenDrawable).setFBOMode(GLFBODrawable.FBOMODE_USE_DEPTH);
+ ((GLFBODrawable)offscreenDrawable).setFBOMode(0);
}
offscreenContext = (GLContextImpl) offscreenDrawable.createContext(shareWith[0]);