aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-09-20 02:51:44 +0200
committerSven Gothel <[email protected]>2014-09-20 02:51:44 +0200
commit711757aa4e087d97c3103489c47fbd7d76bcac3d (patch)
tree89c0b2b8cfc49aa1f3aef93ea23e0643d9c1808f /src/jogl/classes/jogamp/graph
parenta7ff8b898780762b763c0b4544728067375955b6 (diff)
FBObject: Simplify API (init/reset); Only issue automatic resetSamplingSink(..) if required; Fix resetSamplingSink(..), isBound(), ..
- Simplify API (init/reset) - use new unique methods for init and reset: - void init(final GL gl, final int newWidth, final int newHeight, final int newSamples) - does not issue resetSamplingSink(..) - boolean reset(final GL gl, final int newWidth, final int newHeight, final int newSamples) - always issues resetSamplingSink(..) - deprecated dual-use (init/reset): - boolean reset(final GL gl, final int newWidth, final int newHeight) - boolean reset(final GL gl, int newWidth, int newHeight, int newSamples, final boolean resetSamplingSink) - reset(..) no more creates a dummy 'samplingSink' instance if sampling > 0, left up to resetSamplingSink(..) - Track 'modified' state of FBObject, if size, format or any attachment has been changed since last - use(..) - syncSamplingSink(..) - resetSamplingSink(..) - Only issue resetSamplingSink(..) from syncSamplingSink(..)/use(..) if 'modified == true' +++ - Fix setSamplingSink(..), i.e. samplingSink state handling: - Validated whether given samplingSink is initialized, throws Exception if not. - Fix resetSamplingSink(..) - resets the bound state, i.e. leaves it untouched - also unbinds the samplingSink - sampleSinkDepthStencilMismatch() also returns true if this.depth/stencil == null, but samplingSink is not. - Newly created colorbuffer/-texture matches exiting colorbuffer's internal-format, if exists. - Using simplified resetSizeImpl(..) for size mismatch - Simplified samplingColorSink init check - Fix isBound() was: 'bound = bound && fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER)' fix: 'bound = bound && fbName == gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER)' - Fix detachRenderbuffer(..) validates whether detachment was successful, similar to detachColorbuffer(..)
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java6
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
index ca50b5d2d..422714ac5 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
@@ -454,7 +454,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
fboWidth = targetFboWidth;
fboHeight = targetFboHeight;
fbo = new FBObject();
- fbo.reset(gl, fboWidth, fboHeight, sampleCount[0], false);
+ fbo.init(gl, fboWidth, fboHeight, sampleCount[0]);
sampleCount[0] = fbo.getNumSamples();
fbo.attachColorbuffer(gl, 0, true);
if( !blendingEnabled ) {
@@ -463,7 +463,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
}
final FBObject ssink = new FBObject();
{
- ssink.reset(gl, fboWidth, fboHeight);
+ ssink.init(gl, fboWidth, fboHeight, 0);
// FIXME: shall not use bilinear (GL_LINEAR), due to MSAA ???
// ssink.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
ssink.attachTexture2D(gl, 0, true, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
@@ -478,7 +478,7 @@ public class VBORegion2PMSAAES2 extends GLRegion {
System.err.printf("XXX.createFBO: blending %b, %dx%d%n%s%n", blendingEnabled, fboWidth, fboHeight, fbo.toString());
}
} else if( targetFboWidth != fboWidth || targetFboHeight != fboHeight || fbo.getNumSamples() != sampleCount[0] ) {
- fbo.reset(gl, targetFboWidth, targetFboHeight, sampleCount[0], true /* resetSamplingSink */);
+ fbo.reset(gl, targetFboWidth, targetFboHeight, sampleCount[0]);
sampleCount[0] = fbo.getNumSamples();
if( DEBUG_FBO_1 ) {
System.err.printf("XXX.resetFBO: %dx%d -> %dx%d%n%s%n", fboWidth, fboHeight, targetFboWidth, targetFboHeight, fbo );
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
index 24fa09058..5251ade39 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
@@ -573,7 +573,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
fboTexSize.put(1, fboHeight);
}
fbo = new FBObject();
- fbo.reset(gl, fboWidth, fboHeight);
+ fbo.init(gl, fboWidth, fboHeight, 0);
// Shall not use bilinear (GL_LINEAR), due to own VBAA. Result is smooth w/o it now!
// FIXME: FXAA requires bilinear filtering!
// texA = fbo.attachTexture2D(gl, 0, true, GL.GL_LINEAR, GL.GL_LINEAR, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
@@ -586,7 +586,7 @@ public class VBORegion2PVBAAES2 extends GLRegion {
System.err.printf("XXX.createFBO: %dx%d%n%s%n", fboWidth, fboHeight, fbo.toString());
}
} else if( newFboWidth != fboWidth || newFboHeight != fboHeight ) {
- fbo.reset(gl, newFboWidth, newFboHeight);
+ fbo.reset(gl, newFboWidth, newFboHeight, 0);
fbo.bind(gl);
if( DEBUG_FBO_1 ) {
System.err.printf("XXX.resetFBO: %dx%d -> %dx%d, target %dx%d%n", fboWidth, fboHeight, newFboWidth, newFboHeight, targetFboWidth, targetFboHeight);