summaryrefslogtreecommitdiffstats
path: root/src/jogl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-09-20 21:53:26 +0200
committerSven Gothel <[email protected]>2014-09-20 21:53:26 +0200
commit38f6915fedb765313c1f4646acf9e13dfbccef36 (patch)
treed4930367a792070bdbe97db6f5e0f7f82f6dad12 /src/jogl
parentc4865ba2ef6c8ea02e1ca9eb4bfa836deb090d22 (diff)
Bug 1073: FBObject/GLFBODrawable: Remove deprecated methods
- dual-use reset(..), use dedicated init(..) and reset(..) - GLFBODrawable.FBOMODE_USE_DEPTH: Use GLCapabilities.[get|set]DepthBits(int) Note: Applications shall use _requested_ GLCapabilities, if passing caps down to the GLFBODrawable. Otherwise (using _chosen_ caps) we may end up in requesting properties not desired, e.g. stencil bits, if driver has chosen.
Diffstat (limited to 'src/jogl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/FBObject.java59
-rw-r--r--src/jogl/classes/javax/media/opengl/GLFBODrawable.java7
-rw-r--r--src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java4
3 files changed, 6 insertions, 64 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java
index 1e2d296f4..d16bed276 100644
--- a/src/jogl/classes/com/jogamp/opengl/FBObject.java
+++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java
@@ -1090,61 +1090,10 @@ public class FBObject {
* @throws IllegalStateException if not initialized via {@link #init(GL, int, int, int)}.
* @throws GLException in case of an error, i.e. size too big, etc ..
*/
- public final boolean reset(final GL gl, final int newWidth, final int newHeight, final int newSamples) throws GLException, IllegalStateException {
+ public final boolean reset(final GL gl, int newWidth, int newHeight, int newSamples) throws GLException, IllegalStateException {
if( !initialized ) {
throw new IllegalStateException("FBO not initialized");
}
- return reset(gl, newWidth, newHeight, newSamples, true);
- }
-
- /**
- * Initializes or resets this FBO's instance.
- * <p>
- * In case the new parameters are compatible with the current ones
- * no action will be performed. Otherwise all attachments will be recreated
- * to match the new given parameters.
- * </p>
- *
- * <p>Leaves the FBO bound state untouched</p>
- *
- * @param gl the current GL context
- * @param newWidth
- * @param newHeight
- * @return {@code true} if this instance has been modified, otherwise {@code false}.
- * @throws GLException in case of an error
- * @deprecated Use {@link #init(GL, int, int, int)} or {@link #reset(GL, int, int, int)}
- */
- public final boolean reset(final GL gl, final int newWidth, final int newHeight) {
- return reset(gl, newWidth, newHeight, 0, false);
- }
-
- /**
- * Initializes or resets this FBO's instance.
- * <p>
- * In case the new parameters are compatible with the current ones
- * no action will be performed. Otherwise all attachments will be recreated
- * to match the new given parameters.
- * </p>
- *
- * <p>Leaves the FBO bound state untouched</p>
- *
- * @param gl the current GL context
- * @param newWidth the new width, it's minimum is capped to 1
- * @param newHeight the new height, it's minimum is capped to 1
- * @param newSamples if > 0, MSAA will be used, otherwise no multisampling. Will be capped to {@link #getMaxSamples()}.
- * @param resetSamplingSink <code>true</code> calls {@link #resetSamplingSink(GL)} immediatly.
- * <code>false</code> postpones resetting the sampling sink until {@link #use(GL, TextureAttachment)} or {@link #syncSamplingSink(GL)},
- * allowing to use the samples sink's FBO and texture until then. The latter is useful to benefit
- * from implicit double buffering while resetting the sink just before it's being used, eg. at swap-buffer.
- * @return {@code true} if this instance has been modified, otherwise {@code false}.
- * @throws GLException in case of an error, i.e. size too big, etc ..
- * @deprecated Use {@link #init(GL, int, int, int)} or {@link #reset(GL, int, int, int)}
- */
- public final boolean reset(final GL gl, int newWidth, int newHeight, int newSamples, final boolean resetSamplingSink) {
- if( !initialized ) {
- init(gl, newWidth, newHeight, newSamples);
- return true;
- }
newSamples = newSamples <= maxSamples ? newSamples : maxSamples; // clamp
@@ -1182,9 +1131,7 @@ public class FBObject {
samplingSinkDirty = true;
detachAllImpl(gl, true, true, sampleCountChange);
- if( resetSamplingSink ) {
- resetSamplingSink(gl);
- }
+ resetSamplingSink(gl);
if(!wasBound) {
unbind(gl);
@@ -2508,7 +2455,7 @@ public class FBObject {
* @throws GLException if this FBO doesn't use MSAA or the given sink uses MSAA itself
* @throws IllegalStateException if the {@code newSamplingSink} is not null and not initialized
*/
- public FBObject setSamplingSink(final FBObject newSamplingSink) throws /* IllegalStateException, */ GLException {
+ public FBObject setSamplingSink(final FBObject newSamplingSink) throws IllegalStateException, GLException {
final FBObject prev = samplingSink;
if( null == newSamplingSink) {
samplingSink = null;
diff --git a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
index 01db60b2e..07cb723a0 100644
--- a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
@@ -80,11 +80,6 @@ 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)}.
- * @deprecated Use {@link GLCapabilities#setDepthBits(int)}!
- */
- public static final int FBOMODE_USE_DEPTH = 1 << 1;
/** FBO Default Mode Bit: {@link #FBOMODE_USE_TEXTURE}. */
public static final int FBOMODE_DEFAULT = FBOMODE_USE_TEXTURE;
@@ -160,7 +155,7 @@ public interface GLFBODrawable extends GLDrawable {
* @return the new number of buffers (FBO) used, maybe different than the requested <code>bufferCount</code> (see above)
* @throws IllegalStateException if already initialized, see {@link #isInitialized()}.
*/
- int setNumBuffers(final int bufferCount) throws /* IllegalStateException, */ 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/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
index fdd5aa5e9..72caabdd0 100644
--- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
@@ -107,7 +107,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
final FBObject fbo = new FBObject();
fbos[idx] = fbo;
- final boolean useDepth = depthBits > 0 || 0 != ( FBOMODE_USE_DEPTH & fboModeBits );
+ final boolean useDepth = depthBits > 0;
final boolean useStencil = stencilBits > 0;
fbo.init(gl, width, height, samples);
@@ -525,7 +525,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
@Override
- public final int setNumBuffers(final int bufferCount) throws /* IllegalStateException, */ GLException {
+ public final int setNumBuffers(final int bufferCount) throws IllegalStateException, GLException {
if( isInitialized() ) {
throw new IllegalStateException("Already initialized: "+this);
}