NAME
cgSetSamplerStateAssignment - sets a state assignment to a sampler effect parameter.
SYNOPSIS
#include <Cg/cg.h> CGbool cgSetSamplerStateAssignment( CGstateassignment sa, CGparameter param );PARAMETERS
- sa
A state assignment of a sampler type (one of CG_SAMPLER1D, CG_SAMPLER2D CG_SAMPLER3D, CG_SAMPLERCUBE, or CG_SAMPLERRECT).
- param
An effect parameter of a sampler type.
RETURN VALUES
cgSetSamplerStateAssignment returns CG_TRUE if it succeeds in setting the state assignment to the texture parameter; otherwise CG_FLASE.
DESCRIPTION
cgSetSamplerStateAssignment sets a state assignment of a sampler type to an effect parameter of the same sampler type.
EXAMPLES
CGparameter effectParam = cgCreateEffectParameter(effect, "normalizeCube", CG_SAMPLERCUBE); CGstate state = cgGetNamedSamplerState(context, "TextureCubeMap"); CGstateassignment sa = cgCreateStateAssignment(technique, state); CGbool ok = cgSetSamplerStateAssignment(sa, effectParam);ERRORS
If the sa state assignment is invalid, CG_FALSE is returned but no Cg context error is generated.
CG_STATE_ASSIGNMENT_TYPE_MISMATCH_ERROR if the sa state assignment is not of type CG_TEXTURE.
CG_ARRAY_SIZE_MISMATCH_ERROR if the state assignment is an array and not a scalar.
CG_INVALID_PARAM_HANDLE_ERROR if the param parameter is invalid.
HISTORY
cgSetSamplerStateAssignment was introduced in Cg 1.5.
SEE ALSO