diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/FBObject.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/FBObject.java | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java index 03693a688..e1ddc9c66 100644 --- a/src/jogl/classes/com/jogamp/opengl/FBObject.java +++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java @@ -30,20 +30,21 @@ package com.jogamp.opengl; import java.util.Arrays; -import javax.media.opengl.GL; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GL2ES3; -import javax.media.opengl.GL2GL3; -import javax.media.opengl.GL3; -import javax.media.opengl.GLBase; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLCapabilitiesImmutable; -import javax.media.opengl.GLContext; -import javax.media.opengl.GLException; -import javax.media.opengl.GLProfile; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2ES2; +import com.jogamp.opengl.GL2ES3; +import com.jogamp.opengl.GL2GL3; +import com.jogamp.opengl.GL3; +import com.jogamp.opengl.GLBase; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLCapabilitiesImmutable; +import com.jogamp.opengl.GLContext; +import com.jogamp.opengl.GLException; +import com.jogamp.opengl.GLProfile; import jogamp.opengl.Debug; +import com.jogamp.common.ExceptionUtils; import com.jogamp.common.util.PropertyAccess; import com.jogamp.opengl.FBObject.Attachment.Type; @@ -698,10 +699,7 @@ public class FBObject { final int magFilter, final int minFilter, final int wrapS, final int wrapT) { final int dataFormat, dataType; final boolean alpha = hasAlpha(internalFormat); - if( gl.isGLES3() ) { - dataFormat = alpha ? GL.GL_RGBA : GL.GL_RGB; - dataType = GL.GL_UNSIGNED_BYTE; - } else if( gl.isGLES() ) { + if( gl.isGLES() ) { dataFormat = alpha ? GL.GL_RGBA : GL.GL_RGB; dataType = GL.GL_UNSIGNED_BYTE; } else { @@ -1071,7 +1069,7 @@ public class FBObject { vStatus = GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; // always incomplete w/o attachments! if(DEBUG) { System.err.println("FBObject.init() END: "+this); - Thread.dumpStack(); + ExceptionUtils.dumpStack(System.err); } } @@ -1306,7 +1304,7 @@ public class FBObject { final int glerr = gl.glGetError(); if(DEBUG && GL.GL_NO_ERROR != glerr) { System.err.println("Pre-existing GL error: "+toHexString(glerr)); - Thread.dumpStack(); + ExceptionUtils.dumpStack(System.err); } return glerr; } @@ -1520,7 +1518,7 @@ public class FBObject { final TextureAttachment texA = colbuf.getTextureAttachment(); if( samples > 0 ) { removeColorAttachment(attachmentPoint, texA); - if(initializedColorbuf) { + if( initializedColorbuf ) { texA.free(gl); } throw new GLException("Texture2D not supported w/ MSAA. If you have enabled MSAA with exisiting texture attachments, you may want to detach them via detachAllTexturebuffer(gl)."); @@ -1533,9 +1531,9 @@ public class FBObject { if(!ignoreStatus) { updateStatus(gl); - if(!isStatusValid()) { + if( !isStatusValid() ) { detachColorbuffer(gl, attachmentPoint, true); - throw new GLException("attachTexture2D "+texA+" at "+attachmentPoint+" failed "+getStatusString()+", "+this); + throw new GLException("attachTexture2D "+texA+" at "+attachmentPoint+" failed: "+getStatusString()+", "+this); } } } else { @@ -1548,9 +1546,9 @@ public class FBObject { if(!ignoreStatus) { updateStatus(gl); - if(!isStatusValid()) { + if( !isStatusValid() ) { detachColorbuffer(gl, attachmentPoint, true); - throw new GLException("attachColorbuffer "+colA+" at "+attachmentPoint+" failed "+getStatusString()+", "+this); + throw new GLException("attachColorbuffer "+colA+" at "+attachmentPoint+" failed: "+getStatusString()+", "+this); } } } @@ -1796,7 +1794,7 @@ public class FBObject { updateStatus(gl); if( !isStatusValid() ) { detachRenderbuffer(gl, atype, true); - throw new GLException("renderbuffer [attachmentType "+atype+", iformat "+toHexString(internalFormat)+"] failed: "+this.getStatusString()+": "+this.toString()); + throw new GLException("renderbuffer [attachmentType "+atype+", iformat "+toHexString(internalFormat)+"] failed: "+this.getStatusString()+", "+this.toString()); } } @@ -2197,7 +2195,7 @@ public class FBObject { } */ updateStatus(gl); if(!isStatusValid()) { - throw new GLException("detachAllImpl failed "+getStatusString()+", "+this); + throw new GLException("detachAllImpl failed: "+getStatusString()+", "+this); } } } finally { @@ -2306,7 +2304,7 @@ public class FBObject { public final boolean resetSamplingSink(final GL gl) throws GLException { if(DEBUG) { System.err.println("FBObject.resetSamplingSink.0"); - Thread.dumpStack(); + ExceptionUtils.dumpStack(System.err); } if( 0 == samples ) { |