From 9b133d6b0408d08e79f2973eabd4d1d29c695747 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 29 Oct 2013 03:06:57 +0100 Subject: GLDrawableHelper.reshape(): Catch pre-existing GL errors before glViewport(..) and dump it (Add stack trace if DEBUG) --- src/jogl/classes/jogamp/opengl/GLDrawableHelper.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/jogl/classes/jogamp') diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java index cf5d7a206..61735c487 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java @@ -48,6 +48,7 @@ import javax.media.nativewindow.NativeSurface; import javax.media.nativewindow.NativeWindowException; import javax.media.nativewindow.ProxySurface; import javax.media.nativewindow.UpstreamSurfaceHook; +import javax.media.opengl.GL; import javax.media.opengl.GLAnimatorControl; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLContext; @@ -662,6 +663,14 @@ public class GLDrawableHelper { } } if(setViewport) { + final GL gl = drawable.getGL(); + final int glerr0 = gl.glGetError(); + if( GL.GL_NO_ERROR != glerr0 ) { + System.err.println("Info: GLDrawableHelper.reshape: pre-exisiting GL error 0x"+Integer.toHexString(glerr0)); + if(DEBUG) { + Thread.dumpStack(); + } + } drawable.getGL().glViewport(x, y, width, height); } listener.reshape(drawable, x, y, width, height); -- cgit v1.2.3