From 9ce042df68b70a0e62b21b93d2a1a64722e1e49e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 6 Nov 2012 18:11:45 +0100 Subject: FBObject: Rename private fields for better reading: samplesSink* -> samplingSink* --- src/jogl/classes/com/jogamp/opengl/FBObject.java | 130 +++++++++++------------ 1 file changed, 65 insertions(+), 65 deletions(-) (limited to 'src/jogl/classes/com') diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java index 3134d435b..d91650004 100644 --- a/src/jogl/classes/com/jogamp/opengl/FBObject.java +++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java @@ -642,9 +642,9 @@ public class FBObject { private Colorbuffer[] colorAttachmentPoints; // colorbuffer attachment points private RenderAttachment depth, stencil; // depth and stencil maybe equal in case of packed-depth-stencil - private FBObject samplesSink; // MSAA sink - private TextureAttachment samplesSinkTexture; - private boolean samplesSinkDirty; + private FBObject samplingSink; // MSAA sink + private TextureAttachment samplingSinkTexture; + private boolean samplingSinkDirty; // // ColorAttachment helper .. @@ -776,9 +776,9 @@ public class FBObject { this.depth = null; this.stencil = null; - this.samplesSink = null; - this.samplesSinkTexture = null; - this.samplesSinkDirty = true; + this.samplingSink = null; + this.samplingSinkTexture = null; + this.samplingSinkDirty = true; } private void init(GL gl, int width, int height, int samples) throws GLException { @@ -810,7 +810,7 @@ public class FBObject { int realMaxColorAttachments = 1; maxColorAttachments = 1; - if( null != samplesSink && fullFBOSupport || NV_fbo_color_attachments ) { + if( null != samplingSink && fullFBOSupport || NV_fbo_color_attachments ) { try { gl.glGetIntegerv(GL2GL3.GL_MAX_COLOR_ATTACHMENTS, val, 0); realMaxColorAttachments = 1 <= val[0] ? val[0] : 1; // cap minimum to 1 @@ -841,7 +841,7 @@ public class FBObject { if(DEBUG) { System.err.println("FBObject "+width+"x"+height+", "+samples+" -> "+this.samples+" samples"); System.err.println("fullFBOSupport: "+fullFBOSupport); - System.err.println("isSamplesSink: "+(null == samplesSink)); + System.err.println("isSamplesSink: "+(null == samplingSink)); System.err.println("maxColorAttachments: "+maxColorAttachments+"/"+realMaxColorAttachments+" [capped/real]"); System.err.println("maxSamples: "+maxSamples); System.err.println("maxTextureSize: "+maxTextureSize); @@ -883,7 +883,7 @@ public class FBObject { checkNoError(gl, GL.GL_INVALID_VALUE, "FBObject Init.isFB"); // throws GLException } bound = true; - samplesSinkDirty = true; + samplingSinkDirty = true; initialized = true; vStatus = GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; // always incomplete w/o attachments! @@ -970,7 +970,7 @@ public class FBObject { resetSamplingSink(gl); } - samplesSinkDirty = true; + samplingSinkDirty = true; if(!wasBound) { unbind(gl); @@ -1576,11 +1576,11 @@ public class FBObject { colA.setSamples(samples); } else { // switch to non MSAA - if(null != samplesSinkTexture) { - colbuf = createColorTextureAttachment(samplesSinkTexture.format, width, height, - samplesSinkTexture.dataFormat, samplesSinkTexture.dataType, - samplesSinkTexture.magFilter, samplesSinkTexture.minFilter, - samplesSinkTexture.wrapS, samplesSinkTexture.wrapT); + if(null != samplingSinkTexture) { + colbuf = createColorTextureAttachment(samplingSinkTexture.format, width, height, + samplingSinkTexture.dataFormat, samplingSinkTexture.dataType, + samplingSinkTexture.magFilter, samplingSinkTexture.minFilter, + samplingSinkTexture.wrapS, samplingSinkTexture.wrapT); } else { colbuf = createColorTextureAttachment(gl.getGLProfile(), true, width, height); } @@ -1784,8 +1784,8 @@ public class FBObject { * @param gl the current GL context */ public final void detachAll(GL gl) { - if(null != samplesSink) { - samplesSink.detachAll(gl); + if(null != samplingSink) { + samplingSink.detachAll(gl); } detachAllImpl(gl, true/* detachNonColorbuffer */, false /* recreate */); } @@ -1800,8 +1800,8 @@ public class FBObject { * @param gl the current GL context */ public final void detachAllColorbuffer(GL gl) { - if(null != samplesSink) { - samplesSink.detachAllColorbuffer(gl); + if(null != samplingSink) { + samplingSink.detachAllColorbuffer(gl); } detachAllImpl(gl, false/* detachNonColorbuffer */, false /* recreate */); } @@ -1818,8 +1818,8 @@ public class FBObject { if( !isInitialized() ) { return; } - if(null != samplesSink) { - samplesSink.detachAllTexturebuffer(gl); + if(null != samplingSink) { + samplingSink.detachAllTexturebuffer(gl); } bind(gl); for(int i=0; i 0 ) { if( newSamplingSink.getNumSamples() > 0 ) { throw new GLException("SamplingSink FBO cannot use MSAA itself: "+newSamplingSink); } - samplesSink = newSamplingSink; - samplesSinkTexture = (TextureAttachment) newSamplingSink.getColorbuffer(0); + samplingSink = newSamplingSink; + samplingSinkTexture = (TextureAttachment) newSamplingSink.getColorbuffer(0); } else { throw new GLException("Setting SamplingSink for non MSAA FBO not allowed: "+this); } - samplesSinkDirty = true; + samplingSinkDirty = true; } /** @@ -2075,7 +2075,7 @@ public class FBObject { } bound = true; - samplesSinkDirty = true; + samplingSinkDirty = true; } } @@ -2154,12 +2154,12 @@ public class FBObject { */ public final void syncSamplingSink(GL gl) { markUnbound(); - if(samples>0 && samplesSinkDirty) { - samplesSinkDirty = false; + if(samples>0 && samplingSinkDirty) { + samplingSinkDirty = false; resetSamplingSink(gl); checkPreGLError(gl); gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, fbName); - gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, samplesSink.getWriteFramebuffer()); + gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, samplingSink.getWriteFramebuffer()); ((GL2GL3)gl).glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, // since MSAA is supported, casting to GL2GL3 is OK GL.GL_COLOR_BUFFER_BIT, GL.GL_NEAREST); checkNoError(null, gl.glGetError(), "FBObject syncSampleSink"); // throws GLException if error @@ -2275,7 +2275,7 @@ public class FBObject { /** Returns the framebuffer name to render to. */ public final int getWriteFramebuffer() { return fbName; } /** Returns the framebuffer name to read from. Depending on multisampling, this may be a different framebuffer. */ - public final int getReadFramebuffer() { return ( samples > 0 ) ? samplesSink.getReadFramebuffer() : fbName; } + public final int getReadFramebuffer() { return ( samples > 0 ) ? samplingSink.getReadFramebuffer() : fbName; } /** Return the number of color/texture attachments */ public final int getColorAttachmentCount() { return colorAttachmentCount; } /** Return the stencil {@link RenderAttachment} attachment, if exist. Maybe share the same {@link Attachment#getName()} as {@link #getDepthAttachment()}, if packed depth-stencil is being used. */ @@ -2284,16 +2284,16 @@ public class FBObject { public final RenderAttachment getDepthAttachment() { return depth; } /** Return the complete multisampling {@link FBObject} sink, if using multisampling. */ - public final FBObject getSamplingSinkFBO() { return samplesSink; } + public final FBObject getSamplingSinkFBO() { return samplingSink; } /** Return the multisampling {@link TextureAttachment} sink, if using multisampling. */ - public final TextureAttachment getSamplingSink() { return samplesSinkTexture; } + public final TextureAttachment getSamplingSink() { return samplingSinkTexture; } /** * Returns true if the multisampling colorbuffer (msaa-buffer) * has been flagged dirty by a previous call of {@link #bind(GL)}, * otherwise false. */ - public final boolean isSamplingBufferDirty() { return samplesSinkDirty; } + public final boolean isSamplingBufferDirty() { return samplingSinkDirty; } int objectHashCode() { return super.hashCode(); } @@ -2302,7 +2302,7 @@ public class FBObject { return "FBO[name r/w "+fbName+"/"+getReadFramebuffer()+", init "+initialized+", bound "+bound+", size "+width+"x"+height+ ", samples "+samples+"/"+maxSamples+", depth "+depth+", stencil "+stencil+ ", color attachments: "+colorAttachmentCount+"/"+maxColorAttachments+ - ": "+caps+", msaa-sink "+samplesSinkTexture+", hasSamplesSink "+(null != samplesSink)+ + ": "+caps+", msaa-sink "+samplingSinkTexture+", hasSamplesSink "+(null != samplingSink)+ ", state "+getStatusString()+", obj "+toHexString(objectHashCode())+"]"; } -- cgit v1.2.3