Are all the GL functions there?

Started by blingo, October 17, 2008, 15:37:57

Previous topic - Next topic

blingo

Hello, new to LWJGL,
love it already, as it was a smooth sailing on Eclipse.

Learning the Red Book,
tried to find glColor3fv, and also some OpenGL Type Definitions,
are they all there?

Many thanks.

Ciardhubh

Quote from: blingo on October 17, 2008, 15:37:57
tried to find glColor3fv, and also some OpenGL Type Definitions,
are they all there?

OpenGL functions are named slightly different. The f, v, i, etc. suffixes indicate the type (f = float) and v in OpenGL is a pointer to an array containing the type. As there are no pointers in Java, the v is omitted. It's glColor3f(...). If the parameter type is obvious (e.g. FloatBuffer as parameter), even the f is omitted.

You also have to find the right class the method is in; named after the version it had been introduced in OpenGL (i.e. GL11, GL15, GLU, etc). Some functions are in ARB extensions and not one of the GLXX classes.

Since you are using Eclipse, it's probably easiest to use auto-completion. For example type GL11.glColor3 and hit Strg+Space. This should give you a list of options. If you are completely lost and cannot find the class the method is in, just search the LWGJL source code (e.g. search for glcolor).