cgAddStateEnumerant
Keywords: cgAddStateEnumerant, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## Name

> cgAddStateEnumerant - associates an integer enumerant value as a possible value for a state

> ## Synopsis

>     #include <Cg/cg.h>

>     void cgAddStateEnumerant( CGstate state,
>                               const char * name,
>                               int value );

> ## Parameters

> state
>   The state to which to associate the name and value.
> name
>   The name of the enumerant.
> value
>   The value of the enumerant.

> ## Return Values

> None.

> ## Description

> cgAddStateEnumerant associates a given named integer enumerant value with a state definition. When that state is later used in a pass in an effect file, the value of the state assignment can optionally be given by providing a named enumerant defined with cgAddStateEnumerant. The state assignment will then take on the value provided when the enumerant was defined.

> ## Examples

> to-be-written

> ## Errors

> CG_INVALID_STATE_HANDLE_ERROR is generated if state is not a valid state.

> ## History

> cgAddStateEnumerant was introduced in Cg 1.4.

> ## See Also

> cgCreateState, cgCreateArrayState, cgCreateSamplerState, cgCreateArraySamplerState, cgGetStateName