Main Menu

Using GL42

Started by ghillieLEAD, November 05, 2011, 05:54:33

Previous topic - Next topic

ghillieLEAD

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? 

kappa

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 tell you that it was introduced in OpenGL 2.0, hence you would need to import GL20.

ghillieLEAD

Thanks so much for clearing that up for me!