DebugGL2ES2?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

DebugGL2ES2?

lpvb
I want to debug my gl code using the GL2ES2 profile, but I'm not sure how to do that without DebugGL2ES2 anywhere. Is that possible?
Reply | Threaded
Open this post in threaded view
|

Re: DebugGL2ES2?

gouessej
Administrator
Hi

Why not using DebugGLES2 when GLProfile.isGLES2() returns true or DebugGL2 when GLProfile.isGL2() returns true?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: DebugGL2ES2?

lpvb
Because I want to use the common subset of GL2 and GLES2? What's the purpose of GL2ES2 otherwise?
Reply | Threaded
Open this post in threaded view
|

Re: DebugGL2ES2?

Sven Gothel
Administrator
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
Reply | Threaded
Open this post in threaded view
|

Re: DebugGL2ES2?

Sven Gothel
Administrator
In reply to this post by lpvb
On 12/20/2013 09:43 AM, Sven Gothel wrote:
> 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?
>>
https://jogamp.org/wiki/index.php/How_to_use_the_Debug_and_Trace_GL_Pipeline_and_Debug_GL_Context



signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: DebugGL2ES2?

gouessej
Administrator
Thank you. I will modify Ardor3D source code to use that stuff.
Julien Gouesse | Personal blog | Website