summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-08-17 13:47:48 +0200
committerSven Gothel <[email protected]>2012-08-17 13:47:48 +0200
commitee5c34e5bb067631572a7001ab1ec3543c52065f (patch)
tree6bd997c3da8e114b923faf66015fdbaac5791f24 /src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
parent09a8151abe3934ccf17fa84d5b2000e259351312 (diff)
Robostness: GLDrawableImpl's contextMadeCurrent()/contextRealized() ; GLFBODrawableImpl.contextMadeCurrent(false), OffscreenAutoDrawable.setSize(..)
GLDrawableImpl's contextMadeCurrent()/contextRealized(): - Catch exception which may appear during callback and cont. w/ GLContextImpl's release()/destroy() while throwing catched exception at end. GLFBODrawableImpl.contextMadeCurrent(false): - Detect null Colorbuffer ASAP and throw exception OffscreenAutoDrawable.setSize(..): - Catch exceptions at 1) GLFBODrawableImpl.setSize(..) and 2) GLContext.release() .. throw it in proper order.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
index b7ea4f826..03bc26cbc 100644
--- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
@@ -69,8 +69,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl {
fbo.bind(gl);
} else {
fbo.unbind(gl);
+ final TextureAttachment attachment = samples > 0 ? fbo.getSamplingSink() : (TextureAttachment) fbo.getColorbuffer(0) ;
+ if(null == attachment) {
+ throw new GLException("Null texture colorbuffer, samples "+samples+", "+fbo.toString());
+ }
gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit);
- fbo.use(gl, samples > 0 ? fbo.getSamplingSink() : (TextureAttachment) fbo.getColorbuffer(0) );
+ fbo.use(gl, attachment );
if( samples > 0) {
gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, fbo.getReadFramebuffer());
}