> ## Name

> cgGetNextStateAssignment - iterate through state assignments in a pass

> ## Synopsis

>     #include <Cg/cg.h>

>     CGstateassignment cgGetNextStateAssignment( CGstateassignment sa );

> ## Parameters

> sa
>   The current state assignment.

> ## Return Values

> Returns the next state assignment in the pass' internal sequence of state assignments.

> Returns NULL when prog is the last state assignment in the pass.

> ## Description

> The state assignments within a pass can be iterated over by using cgGetNextStateAssignment.

> State assignments are returned in the same order specified in the pass in the effect.

> ## Examples

>     CGstateassignment sa = cgGetFirstStateAssignment( pass );
>     while( sa )
>     {
>       /* do something with sa */
>       sa = cgGetNextStateAssignment( sa );
>     }

> ## Errors

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

> ## History

> cgGetNextStateAssignment was introduced in Cg 1.4.

> ## See Also

> cgGetFirstStateAssignment, cgGetNamedStateAssignment, cgIsStateAssignment