Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the 'iv' in glGetShaderiv() stand for?

Tags:

opengl

What does the iv at the end of glGetShaderiv() stand for?

like image 258
David Limkys Avatar asked Mar 15 '13 18:03

David Limkys


3 Answers

It describes the parameters returned, in this case a vector of ints. The same nomenclature is used for glTexParameteriv and glTexParameterfv for example, which updates a vector of ints or floats respectively.

like image 135
Brett Hale Avatar answered Nov 08 '22 12:11

Brett Hale


OpenGL has some organized naming conventions regarding the routines they have in the libraries.

Prefixes

All routines have a gl before them. Similar thing you must have observed with glu and glut. Some vender libraries also have prefixes like NVidia guys have put up a NV_ prefix in the hardware feature flags.

Suffixes

Suffixes usually are an indicator to what kind of arguments does the method take.

  • Some specifying the context of the function. e.g. 1D, 2D or 3D e.g. glTexCoord2D

  • Kind of value types is a function's argument taking. e.g. glTranslatef takes GLfloat arguments (observe that even the data types follow the same naming convention) and glTranslated take GLdouble.

  • The source of the vertices (usually when there are too many vertices and you store them in a single array) taking the method you have mentioned: glGetShaderiv is a function, takes the parameters for shaders, where datatype is GLint and the source of data is a vector (v).

You can take such kind of conventions to easily identify that what method takes what kind of arguments.

like image 23
activatedgeek Avatar answered Nov 08 '22 12:11

activatedgeek


It indicates you want to get a value that is an array of integers. The function reference can be found here, and as you can see, the return param is a GLint *. This is in contrast to functions such as glGetInternalFormati64v, which has a return param of GLint64 *. I believe, but can't locate at the moment, that there have been functions using the fv suffix to denote floats, and possibly others.

like image 38
ssube Avatar answered Nov 08 '22 13:11

ssube