glNormalPointer — define an array of normals

C Specification

void glNormalPointer(GLenum type,
 GLsizei stride,
 const GLvoid * pointer);



Specifies the data type of each coordinate in the array. Symbolic constants GL_BYTE, GL_SHORT, and GL_FIXED are accepted. However, the initial value is GL_FLOAT.

The common profile accepts the symbolic constant GL_FLOAT as well.


Specifies the byte offset between consecutive normals. If stride is 0, the normals are understood to be tightly packed in the array. The initial value is 0.


Specifies a pointer to the first coordinate of the first normal in the array. The initial value is 0.


glNormalPointer specifies the location and data of an array of normals to use when rendering. type specifies the data type of the normal coordinates and stride gives the byte stride from one normal to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) When a normal array is specified, type , stride , and pointer are saved as client-side state.

If the normal array is enabled, it is used when glDrawArrays or glDrawElements is called. To enable and disable the normal array, call glEnableClientState and glDisableClientState with the argument GL_NORMAL_ARRAY. The normal array is initially disabled and isn't accessed when glDrawArrays or glDrawElements is called.



glNormalPointer is typically implemented on the client side.


GL_INVALID_ENUM is generated if type is not an accepted value.

GL_INVALID_VALUE is generated if stride is negative.

See Also

glColorPointer, glDrawArrays, glDrawElements, glEnable, glTexCoordPointer, glVertexPointer

