[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glIndex Subroutine

Purpose

Sets the current color index.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glIndexd(GLdouble Current)
void glIndexf(GLfloat Current)
void glIndexi(GLint Current)
void glIndexs(GLshort Current)
void glIndexdv(const GLdouble *Current)
void glIndexfv(const GLfloat *Current)
void glIndexiv(const GLint *Current)
void glIndexsv(const GLshort *Current)
void glIndexub(GLubyte Current)
void glIndexubv(const GLubyte *Current)

Parameters

Current In the case of glIndexd, glIndexf, glIndexi, glIndexs, and glIndexub this parameter specifies the new value for the current color index.

In the case of glIndexdv, glIndexfv, glIndexiv, glIndexsv, and glIndexubv this parameter specifies a pointer to a one-element array that contains the new value for the current color index.

Description

The glIndex subroutine updates the current (single-valued) color index. It takes one argument, the new value for the current color index.

The current index is stored as a floating-point value. Integer values are converted directly to floating-point values, with no special mapping.

Index values outside the representable range of the color index buffer are not clamped. However, before an index is dithered (if enabled) and written to the frame buffer, it is converted to fixed-point format. Any bits in the integer portion of the resulting fixed-point value that do not correspond to bits in the frame buffer are masked out.

Notes

The current index can be updated at any time. In particular, glIndex can be called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

Associated gets for the glIndex subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_CURRENT_INDEX.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glBegin subroutine, glColor subroutine, glEnd subroutine, glIndexPointer subroutine, glIndexPointerEXT subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]