David Limkys
David Limkys

Reputation: 5133

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

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

Upvotes: 36

Views: 4149

Answers (3)

nyumerics
nyumerics

Reputation: 6547

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.

Upvotes: 12

Brett Hale
Brett Hale

Reputation: 22348

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.

Upvotes: 42

ssube
ssube

Reputation: 48327

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.

Upvotes: 4

Related Questions