Checking what functions are supported by jogl

Hello,

I was wondering how to get information whether a certain function is supported in a particular jogl-implementation.
For example, I want to check, whether people have a jogl that also supports the OpenGL 1.5 functions or shader extension.
Just checking the version/extension string doesn’t help as this reports the extension as being available, but jogl doesn’t provide entrypoints to them.
Now I could use reflection but maybe there’s a cleaner way?

Thanks for your answers,

Jan


    String extensions = gl.glGetString(gl.GL_EXTENSIONS);  // Fetch Extension String

    if(extensions.indexOf("GL_EXT_stencil_wrap") !=-1)
      EXT_stencil_wrap_supported = true;

    if(extensions.indexOf("GL_ARB_vertex_program") !=-1)
      ARB_vertex_program_supported = true;

    if(extensions.indexOf("GL_EXT_stencil_two_side") !=-1)
      EXT_stencil_two_side_supported = true;

    if(EXT_stencil_two_side_supported && EXT_stencil_wrap_supported)
      twoSidedStencilSupported = true;

    if(ARB_vertex_program_supported)
      VPVolumesSupported = true;

Jeickmann:

Just bundle the specific version of jogl you use with your game. It’s not big, and it makes it easier for the player to run your game, as he doesn’t have to install anything else.

Java Cool Dude:

Doing it that way would incorrectly say GL_EXT_texture is supported if GL_EXT_texture3D (but not GL_EXT_texture) is supported.
There are more name conflicts like that.

this just checks the extension string, which doesn’t help if my driver supports for example ARB_fragment_shader, but the jogl doesn’t provide a wrapper for it because it has been compiled with the OpenGL 1.4 glext.h

I guess, it’s either reflection or bundling the jogl like Markus_Persson suggested.

Thanks you anyway,

Jan