LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: gutomarzagao on February 15, 2012, 17:37:13

Title: OpenGL version through LWJGL
Post by: gutomarzagao on February 15, 2012, 17:37:13
Hi everybody,
It may be a newbie question, but I've searched it and I couldn't the answer..
How do I get current openGL version?
Title: Re: OpenGL version through LWJGL
Post by: kappa on February 15, 2012, 19:54:41
You can use GLContext.getCapabilities() method to detect this.

So if you want to test if OpenGL 2.0 is supported, you'd do something like

if(GLContext.getCapabilities().OpenGL20) {
// opengl 2.0 supported.
}


Full list of capabilities that you can test are found on the javadoc here (http://lwjgl.org/javadoc/org/lwjgl/opengl/ContextCapabilities.html).
Title: Re: OpenGL version through LWJGL
Post by: gutomarzagao on February 15, 2012, 20:08:49
Solved!
Thanks.
Title: Re: OpenGL version through LWJGL
Post by: Mickelukas on February 15, 2012, 22:02:22
When using getCapabilities, make sure you don't rely on it for something extremely important. I've had enough bug reports on crappy intel cards that even with the newest driver say that they support something when they actually don't...

Mike