NAME

glColorMaterial - cause a material color to track the current color

C SPECIFICATION

void ggllCCoolloorrMMaatteerriiaall( GLenum _f_a_c_e,
                      GLenum _m_o_d_e )

PARAMETERS

_f_a_c_e
Specifies whether front, back, or both front and back material parameters should track the current color. Accepted values are GGLL__FFRROONNTT, GGLL__BBAACCKK, and GGLL__FFRROONNTT__AANNDD__BBAACCKK. The initial value is GGLL__FFRROONNTT__AANNDD__BBAACCKK.
_m_o_d_e
Specifies which of several material parameters track the current color. Accepted values are GGLL__EEMMIISSSSIIOONN, GGLL__AAMMBBIIEENNTT, GGLL__DDIIFFFFUUSSEE, GGLL__SSPPEECCUULLAARR, and GGLL__AAMMBBIIEENNTT__AANNDD__DDIIFFFFUUSSEE. The initial value is GGLL__AAMMBBIIEENNTT__AANNDD__DDIIFFFFUUSSEE.

DESCRIPTION

ggllCCoolloorrMMaatteerriiaall specifies which material parameters track the current color. When GGLL__CCOOLLOORR__MMAATTEERRIIAALL is enabled, the material parameter or parameters specified by _m_o_d_e, of the material or materials specified by _f_a_c_e, track the current color at all times.

To enable and disable GGLL__CCOOLLOORR__MMAATTEERRIIAALL, call ggllEEnnaabbllee and ggllDDiissaabbllee with argument GGLL__CCOOLLOORR__MMAATTEERRIIAALL. GGLL__CCOOLLOORR__MMAATTEERRIIAALL is initially disabled.

NOTES

ggllCCoolloorrMMaatteerriiaall makes it possible to change a subset of material parameters for each vertex using only the ggllCCoolloorr command, without calling ggllMMaatteerriiaall. If only such a subset of parameters is to be specified for each vertex, calling ggllCCoolloorrMMaatteerriiaall is preferable to calling ggllMMaatteerriiaall.

Call ggllCCoolloorrMMaatteerriiaall before enabling GGLL__CCOOLLOORR__MMAATTEERRIIAALL.

Calling ggllDDrraawwEElleemmeennttss, ggllDDrraawwAArrrraayyss, or ggllDDrraawwRRaannggeeEElleemmeennttss may leave the current color indeterminate, if the color array is enabled. If ggllCCoolloorrMMaatteerriiaall is enabled while the current color is indeterminate, the lighting material state specified by _f_a_c_e and _m_o_d_e is also indeterminate.

If the GL version is 1.1 or greater, and GGLL__CCOOLLOORR__MMAATTEERRIIAALL 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.

ERRORS

GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _f_a_c_e or _m_o_d_e is not an accepted value.

GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllCCoolloorrMMaatteerriiaall is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.

ASSOCIATED GETS

ggllIIssEEnnaabblleedd with argument GGLL__CCOOLLOORR__MMAATTEERRIIAALL
ggllGGeett with argument GGLL__CCOOLLOORR__MMAATTEERRIIAALL__PPAARRAAMMEETTEERR
ggllGGeett with argument GGLL__CCOOLLOORR__MMAATTEERRIIAALL__FFAACCEE

SEE ALSO

ggllCCoolloorr((33GG)), ggllCCoolloorrPPooiinntteerr((33GG)), ggllDDrraawwAArrrraayyss((33GG)), ggllDDrraawwEElleemmeennttss((33GG)), ggllDDrraawwRRaannggeeEElleemmeennttss((33GG)), ggllEEnnaabbllee((33GG)), ggllLLiigghhtt((33GG)), ggllLLiigghhttMMooddeell((33GG)), ggllMMaatteerriiaall((33GG))