LWJGL Forum

Programming => OpenGL => Topic started by: ghillieLEAD on November 05, 2011, 05:54:33

Title: Using GL42
Post by: ghillieLEAD on November 05, 2011, 05:54:33
In the past I have only ever worked with GL11.  Now I want to use shaders and the cool new features.  However, when I use:

import static org.lwjgl.opengl.GL42.*;

only a handfull of OpenGL functions are available to me.  Do I need to import past versions as well?  Am I missing something/doing something wrong? 
Title: Re: Using GL42
Post by: kappa on November 05, 2011, 07:29:22
yes, you need to import other opengl classes too, since methods are in the classes depending on the OpenGL version they were introduced. Usually the best way to do this is by using the OpenGL SDK  http://www.opengl.org/sdk/

e.g. If I want to use glShaderSource, the docs (notes section) here (http://www.opengl.org/sdk/docs/man/xhtml/glShaderSource.xml) tell you that it was introduced in OpenGL 2.0, hence you would need to import GL20.
Title: Re: Using GL42
Post by: ghillieLEAD on November 05, 2011, 16:18:50
Thanks so much for clearing that up for me!