GLCOLORMATERIAL(3G) GLCOLORMATERIAL(3G)
NAME
glColoraterial - cause a material color to track the current color
C SPECIFICATION
void glColoraterial( GLenum face,
GLenum mode )
PARAMETERS
face Specifies whether front, back, or both front and back material
parameters should track the current color. Accepted values are
GLFRONT, GLBACK, and GLFRONTANDBACK. The initial value is
GLFRONTANDBACK.
mode Specifies which of several material parameters track the current
color. Accepted values are GLEMISION, GLAMBIENT, GLDIFUSE,
GLSPECULAR, and GLAMBIENTANDIFUSE. The initial value is
GLAMBIENTANDIFUSE.
DESCRIPTION
glColoraterial specifies which material parameters track the current
color. When GLCOLORMATERIAL is enabled, the material parameter or
parameters specified by mode, of the material or materials specified by
face, track the current color at all times.
To enable and disable GLCOLORMATERIAL, call glEnable and glDisable
with argument GLCOLORMATERIAL. GLCOLORMATERIAL is initially dis-
abled.
NOTES
glColoraterial makes it possible to change a subset of material param-
eters for each vertex using only the glColor command, without calling
glaterial. If only such a subset of parameters is to be specified for
each vertex, calling glColoraterial is preferable to calling
glaterial.
Call glColoraterial before enabling GLCOLORMATERIAL.
Calling glDrawElements, glDrawArrays, or glDrawRangeElements may leave
the current color indeterminate, if the color array is enabled. If
glColoraterial is enabled while the current color is indeterminate,
the lighting material state specified by face and mode is also indeter-
minate.
If the GL version is 1.1 or greater, and GLCOLORMATERIAL is enabled,
evaluated color values affect the results of the lighting equation as
if the current color were being modified, but no change is made to the
tracking lighting parameter of the current color.
ERORS
GLINVALIDENUM is generated if face or mode is not an accepted value.
GLINVALIDOPERATION is generated if glColoraterial is executed
between the execution of glBegin and the corresponding execution of
glEnd.
ASOCIATED GETS
glIsEnabled with argument GLCOLORMATERIAL
glGet with argument GLCOLORMATERIALPARAMETER
glGet with argument GLCOLORMATERIALFACE
SEE ALSO
glColor, glColorPointer, glDrawArrays, glDrawElements,
glDrawRangeElements, glEnable, glLight, glLightodel, glaterial
GLCOLORMATERIAL(3G)
|