Page 300 OpenGL Super Bible! glIndex Purpose Sets (Free web hosting with ftp)

Page 300 OpenGL Super Bible! glIndex Purpose Sets the current color index to be used for color operations. Include File Variations void glIndexd(GLdouble c); void glIndexf(GLfloat c); void glIndexi(GLint c); void glIndexs(GLshort c); void glIndexdv(const GLdouble *c); void glIndexfv(const GLfloat *c); void glIndexiv(const GLint *c); void glIndexsv(const GLshort *c); Description This function changes the current color index to the one specified by c. This indexvalue is maintained internally as a floating point number. Parameters The new color index to use for all subsequent operations. *cA pointer to the new color index to use for all subsequent operations. Returns None. Example The following code from the sample program INDEX draws a smoothly shaded triangle. The top of the triangle is set to color index 0 which has been set to zero, and the bottom corners to color index 255 which has been set to bright red. // Draw the triangle glBegin(GL_TRIANGLES); // Darkest Red Apex (black) glIndexi(0); glVertex3f(0.0f,200.0f,0.0f); // Brightest red bottom corners glIndexi(255); glVertex3f(200.0f,-70.0f,0.0f); glVertex3f(-200.0f, -70.0f, 0.0f); glEnd(); See Also glColor
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply