> ## Name

> cgGetNamedState - get a context state by name

> ## Synopsis

>     #include <Cg/cg.h>

>     CGstate cgGetNamedState( CGcontext context,
>                              const char * name );

> ## Parameters

> context
>   The context from which to retrieve the state.
> name
>   The name of the state to retrieve.

> ## Return Values

> Returns the named state from the context.

> Returns NULL if the context has no state corresponding to name.

> ## Description

> The states of a context can be retrieved directly by name using cgGetNamedState. The names of the states in a context can be discovered by iterating through the context's states (see cgGetFirstState and cgGetNextState), calling cgGetStateName for each one in turn.

> ## Examples

> to-be-written

> ## Errors

> CG_INVALID_PARAMETER_ERROR is generated if name is NULL.

> ## History

> cgGetNamedState was introduced in Cg 1.4.

> ## See Also

> cgCreateState, cgGetFirstState, cgGetNextState, cgGetStateEnumerantName, cgGetStateEnumerantValue, cgGetStateName, cgGetStateType, cgIsState