LWJGL Forum

Programming => OpenGL => Topic started by: Hurricane on July 22, 2008, 10:25:46

Title: glGetShaderiv and glGetProgramiv renamed to glGetShader and glGetProgram ?
Post by: Hurricane on July 22, 2008, 10:25:46
Hello

I'm trying to use shaders with LWJGL, but it seems I'm unable to use glGetShaderiv.
With a quick search in the source code, I found that they are instead called "glGetProgram" and "glGetShader".
Is there a reason for this ?

Just curious.

Thanks for this wonderful library.

Hurricane
Title: Re: glGetShaderiv and glGetProgramiv renamed to glGetShader and glGetProgram ?
Post by: Ciardhubh on July 22, 2008, 12:29:12
Since Java supports overloading of methods depending on the type of parameters, there is no need to differentiate various OpenGL int, float, double, etc. functions by their names AND their parameters. If the parameter is for example an IntBuffer, the intended function was originally gl*i. The v is missing because it indicates a pointer if I remember correctly. Java doesn't have a concept of pointers similar to C and LWJGL always uses buffers, except for simple values.

f, i, d, etc. suffixes are only present if parameters can be ambiguous. For example a 1 can be a double, a float or an integer if passed to glTranslate(). But an IntBuffer is always an Intbuffer.

At least that is how I'd explain it.