Version of OpenGL

Hi guys,

I am new in OpenGL - can anyone tell me, How can I write simple code (In Java) to know what version, vendor, renderer and extension of OpengGL I am using?

I would like to define these four string variables to hold all the results querying GL_VENDOR,GL_RENDERER, GL_VERSION and GL_EXTENSIONS and add some code in the init() method to query these results. Then create a new JFrame and write the results into it.

Anyone can help me please?
Thank you.

I tried to do as following in the init() method:


but it does not like the glGetString - so should I put it as gl.glGetString(GL_VERSION);?

Anyone please?


Is a good way to check gl version but AFTER creating opengl context. Extensions are queried by similar method. Look at Java bindings docs.

Thanks…got it there at the end…!