How can I call glGetString(GL_RENDERER) without creating a window?

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

How can I call glGetString(GL_RENDERER) without creating a window?

Agnes
I want to get the renderer name, but I do not want to create a frame and and render an image - but it seems that is the only way to get hold of a GL2 instance.

Is there a way?

Best regards,

Agnes
Reply | Threaded
Open this post in threaded view
|

Re: How can I call glGetString(GL_RENDERER) without creating a window?

Agnes
I tried:

GL gl = GLContext.getCurrentGL();

But this predictably gave me an exception that there is no current GL on my thread.
Reply | Threaded
Open this post in threaded view
|

Re: How can I call glGetString(GL_RENDERER) without creating a window?

gouessej
Administrator
You need at least a current OpenGL context to get this information. We have the applet "Quick Version Info" that does what you want (and even more), there is no real JOGL canvas in it, only plain AWT components to display the information, you can find its source code on our Github repository.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: How can I call glGetString(GL_RENDERER) without creating a window?

Agnes
Thanks - found it.

jogl / src / jogl / classes / jogamp / opengl / awt / VersionApplet.java

It seems to be what I'm looking for.