glMatrixMode

NAME

glMatrixMode - specify which matrix is the current matrix

C SPECIFICATION

void glMatrixMode(GLenum mode)

PARAMETERS

mode Specifies which matrix stack is the target for subsequent matrix operations. Four value are accepted: GL_MODELVIEW, GL_PROJECTION, GL_TEXTURE, and GL_COLOR_MATRIX_EXT.

DESCRIPTION

glMatrixMode sets the current matrix mode. mode can assume one of the four values:
GL_MODELVIEW
Applies subsequent matrix operations to the modelview matrix stack.

GL_PROJECTION
Applies subsequent matrix operations to the projection matrix stack.

GL_TEXTURE
Applies subsequent matrix operations to the texture matrix stack.

GL_COLOR_MATRIX_EXT
Applies subsequent matrix operations to the color matrix stack.
To find out which matrix stack is currently the target of all matrix operations, call glGet with the argument GL_MATRIX_MODE. The initial value is GL_MODELVIEW.

EXTENSIONS

Some routines and constants for this function are part of an extension, not part of the core GL command set. The following extension names must be present in the string returned by glGetString when called with argument GL_EXTENSIONS to use these routines and constants.
GL_EXT_color_matrix
GL_COLOR_MATRIX_EXT is part of the EXT_color_matrix extension.

ERRORS

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if glMatrixMode is called between a call to glEnd.

ASSOCIATED GETS

glGet with argument GL_MATRIX_MODE

SEE ALSO

glBegin, glEnd, glGetString, glLoadMatrix, glPixelTransfer, glPushMatrix