aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
diff options
context:
space:
mode:
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());
}