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

> ## Name

> cgSetStateLatestProfile - sets a state's designated latest profile

> ## Synopsis

>     #include <Cg/cg.h>

>     CGprofile cgSetStateLatestProfile( CGstate state, CGprofile profile );

> ## Parameters

> state
>   The state handle.
> profile
>   The profile to designate as the state's latest profile.

> ## Return Values

> None.

> ## Description

> cgSetStateLatestProfile sets the specified state's designated latest profile for states of type CG_PROGRAM_TYPE.

> This profile is used to compile the program for a state assignment for the state where the profile in the compile statement is the identifier latest.

> ## Examples

> This shows how to force the designated latest state profile for the FragmentProgram state assignment to be the arbfp1 profile (even if cgGLRegisterStates was to register a different profile).

>     cgGLRegisterStates(context);
>     CGstate state = cgGetNamedState(context, "FragmentProgram");
>     cgSetStateLatestProfile(state, CG_PROFILE_ARBFP1);

> ## Errors

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

> CG_STATE_ASSIGNMENT_TYPE_MISMATCH_ERROR is generated if the type of state is not CG_PROGRAM_TYPE.

> ## History

> cgSetStateLatestProfile was introduced in Cg 2.2.

> ## See Also

> cgGetNamedState, cgGetStateLatestProfile, cgGLRegisterStates