Login  Register

Re: DebugGL2ES2?

Posted by Sven Gothel on Dec 20, 2013; 8:43am
URL: https://forum.jogamp.org/DebugGL2ES2-tp4030955p4030989.html

On 12/20/2013 08:54 AM, lpvb [via jogamp] wrote:
> Because I want to use the common subset of GL2 and GLES2? What's the purpose
> of GL2ES2 otherwise?
>

class MyGLEvenListener extends GLEvenListener {

  static boolean once = false;

  public void init(GLAutoDrawable drawable) {
    GL2ES2 gl2es2;
    if( !once ) {
      once = true;
      GL gl = drawable.getGL();
      gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, gl, null) );
      gl2es2 = gl.getGL2ES2();
    } else {
      gl2es2 = drawable.getGL().getGL2ES2();
    }
  }

}


You also can enable 'JVM wide' DebugGL by simply setting property 'jogl.debug.DebugGL':
  -Djogl.debug.DebugGL
This will also enable the native debug context, see below.

(Same goes for TraceGL*)

+++

If you like to use the native debug context as well
you would need to issue:

GLContext ctx = ...; // not yet natively created by 1st makeCurrent()
ctx.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);

.. or:

GLWindow glWin = ... ; // newly create one, not yet visible
glWin.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);

~Sven



signature.asc (911 bytes) Download Attachment