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

> ## Name

> cgGetStateAssignmentState - returns the state type of a particular state assignment

> ## Synopsis

>     #include <Cg/cg.h>

>     CGstate cgGetStateAssignmentState( CGstateassignment sa );

> ## Parameters

> sa
>   The state assignment handle.

> ## Return Values

> Returns the state corresponding to the given state assignment.

> Returns NULL if an error occurs.

> ## Description

> cgGetStateAssignmentState returns the CGstate object that corresponds to a particular state assignment in a pass. This object can then be queried to find out its type, giving the type of the state assignment.

> ## Examples

> to-be-written

> ## Errors

> CG_INVALID_STATE_ASSIGNMENT_HANDLE_ERROR is generated if sa is not a valid state assignment.

> CG_INVALID_STATE_HANDLE_ERROR is generated if the effect doesn't contain a state matching the given state assignment.

> ## History

> cgGetStateAssignmentState was introduced in Cg 1.4.

> ## See Also

> cgGetStateType, cgCreateState, cgCreateArrayState