diff options
author | Sven Gothel <[email protected]> | 2012-09-20 15:25:55 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-09-20 15:25:55 +0200 |
commit | 55e2ff7c04aa4dc1e8838bcf23690dc9e01c0130 (patch) | |
tree | fe3e61838d3820b142dbfe60ebeb290f306d242e /src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java | |
parent | 5684b94b1e7330b0008463bdee170358e9ecfa4c (diff) |
GLReadBufferUtil, ShaderUtil: Catch GLException (and dump if thrown), to increase robustness $ glReadPixels and Get NUM_SHADER_BINARY_FORMATS
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java index 34cc0eb07..b8709f31c 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java @@ -179,7 +179,9 @@ public class GLReadBufferUtil { if(res) { psm.setAlignment(gl, alignment, alignment); readPixelBuffer.clear(); - gl.glReadPixels(0, 0, drawable.getWidth(), drawable.getHeight(), textureDataFormat, textureDataType, readPixelBuffer); + try { + gl.glReadPixels(0, 0, drawable.getWidth(), drawable.getHeight(), textureDataFormat, textureDataType, readPixelBuffer); + } catch(GLException gle) { res = false; gle.printStackTrace(); } readPixelBuffer.position(readPixelSize); readPixelBuffer.flip(); final int glerr1 = gl.glGetError(); |