glIndexMask
The glIndexMask function controls the writing of individual bits in the color-index buffers.
void glIndexMask(
GLuint mask);
Parameters
- mask
A bit mask to enable and disable the writing of individual bits in the color-index buffers. Initially, the mask is all ones.
Remarks
The glIndexMask function controls the writing of individual bits in the color-index buffers. The least significant n bits of mask, where n is the number of bits in a color-index buffer, specify a mask. Wherever a one appears in the mask, the corresponding bit in the color-index buffer (or buffers) is made writable. Where a zero appears, the bit is write-protected.
This mask is used only in color-index mode, and it affects only the buffers currently selected for writing (see glDrawBuffer). Initially, all bits are enabled for writing.
The following function retrieves information related to glIndexMask:
glGet with argument GL_INDEX_WRITEMASK
Error Codes
The following is the error code and its condition.
Error code | Condition |
---|---|
GL_INVALID_OPERATION | glIndexMask was called between a call to glBegin and the corresponding call to glEnd. |
Requirements
** Windows NT/2000:** Requires Windows NT 3.5 or later.
** Windows 95/98:** Requires Windows 95 or later. Available as a redistributable for Windows 95.
** Header:** Declared in Gl.h.
** Library:** Use Opengl32.lib.
See Also
glBegin, glDepthMask, glDrawBuffer, glEnd, glIndex, glStencilMask