From fb12b0b6fa37d3a4136bb04597b3c32b15832c82 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 14 Feb 2014 06:19:35 +0100 Subject: GLReadBufferUtil: Set PACK_ROW_LENGTH for ES3 as well - also set ReadBuffer to default. --- src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java index b7d2980df..25a012bb9 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java @@ -32,6 +32,7 @@ import java.io.File; import java.io.IOException; import javax.media.opengl.GL; +import javax.media.opengl.GL2ES3; import javax.media.opengl.GL2GL3; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLDrawable; @@ -221,8 +222,10 @@ public class GLReadBufferUtil { boolean res = null!=readPixelBuffer && readPixelBuffer.isValid(); if(res) { psm.setAlignment(gl, alignment, alignment); - if(gl.isGL2GL3()) { - gl.getGL2GL3().glPixelStorei(GL2GL3.GL_PACK_ROW_LENGTH, width); + if(gl.isGL2ES3()) { + final GL2ES3 gl2es3 = gl.getGL2ES3(); + gl2es3.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, width); + gl2es3.glReadBuffer(gl2es3.getDefaultReadBuffer()); } readPixelBuffer.clear(); try { -- cgit v1.2.3