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

> ## Name

> cgGetStateEnumerantValue - get state enumerant value by name

> ## Synopsis

>     #include <Cg/cg.h>

>     int cgGetStateEnumerantValue( CGstate state,
>                                   const char * name );

> ## Parameters

> state
>   The state from which to retrieve the value associated with name.
> name
>   The enumerant name for which to retrieve the associated value from state.

> ## Return Values

> Returns the enumerant value associated with name.

> Returns -1 if an error occurs.

> ## Description

> cgGetStateEnumerantValue retrieves the enumerant value associated with a given enumerant name from the specified state.

> ## Examples

> to-be-written

> ## Errors

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

> CG_INVALID_PARAMETER_ERROR is generated if state does not contain name, if name is NULL, or if name points to an empty string.

> ## History

> cgGetStateEnumerantValue was introduced in Cg 1.5.

> ## See Also

> cgGetStateEnumerantName, cgAddStateEnumerant, cgIsState