glNormalPointer function

The glNormalPointer function defines an array of normals.

Syntax

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

Parameters

type

The data type of each coordinate in the array using the following symbolic constants: GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, and GL_DOUBLE.

stride

The byte offset between consecutive normals. When stride is zero, the normals are tightly packed in the array.

pointer

A pointer to the first normal in the array.

Return value

This function does not return a value.

Error codes

The following error codes can be retrieved by the glGetError function.

Name Meaning
GL_INVALID_ENUM
type was not an accepted value.
GL_INVALID_OPERATION
stride or count was negative.

Remarks

The glNormalPointer function specifies the location and data of an array of normals to use when rendering. The type parameter specifies the data type of each normal coordinate. The stride parameter determines the byte offset from one normal to the next, enabling the packing of vertices and attributes in a single array or storage in separate arrays. In some implementations storing the vertices and attributes in a single array can be more efficient than using separate arrays; see glInterleavedArrays for details.

A normal array is enabled when you specify the GL_NORMAL_ARRAY constant with glEnableClientState. When enabled, glDrawArrays, glDrawElements and glArrayElement use the normal array. By default the normal array is disabled.

You cannot include glNormalPointer in display lists.

When you specify a normal array using glNormalPointer, the values of all the function's normal array parameters are saved in a client-side state. Because the normal array parameters are saved in a client-side state, their values are not saved or restored by glPushAttrib and glPopAttrib.

Although no error is generated when you call glNormalPointer within glBegin and glEnd pairs, the results are undefined.

The following functions are associated with glNormalPointer:

glGet with argument GL_NORMAL_ARRAY_STRIDE

glGet with argument GL_NORMAL_ARRAY_COUNT

glGet with argument GL_NORMAL_ARRAY_TYPE

glGetPointerv with argument GL_NORMAL_ARRAY_POINTER

glIsEnabled with argument GL_NORMAL_ARRAY

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Gl.h
Library
Opengl32.lib
DLL
Opengl32.dll

See also

glArrayElement

glColorPointer

glDrawElements

glDrawArrays

glEnable

glEdgeFlagPointer

glGetPointerv

glIndexPointer

glIsEnabled

glInterleavedArrays

glTexCoordPointer

glVertexPointer

glGetString