aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-09-20 15:25:55 +0200
committerSven Gothel <[email protected]>2012-09-20 15:25:55 +0200
commit55e2ff7c04aa4dc1e8838bcf23690dc9e01c0130 (patch)
treefe3e61838d3820b142dbfe60ebeb290f306d242e /src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
parent5684b94b1e7330b0008463bdee170358e9ecfa4c (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.java4
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();