NAME

cgSetTextureStateAssignment - sets a state assignment to a texture effect parameter

SYNOPSIS

  #include <Cg/cg.h>

  CGbool cgSetTextureStateAssignment( CGstateassignment sa,
                                      CGparameter param );

PARAMETERS

sa

A state assignment of type CG_TEXTURE.

param

An effect parameter of type CG_TEXTURE.

RETURN VALUES

cgSetTextureStateAssignment returns CG_TRUE if it succeeds in setting the state assignment to the texture parameter; otherwise CG_FLASE.

DESCRIPTION

cgSetTextureStateAssignment sets a state assignment of type CG_TEXTURE to an effect parameter of type CG_TEXTURE.

EXAMPLES

  CGparameter effectParam = cgCreateEffectParameter(effect, "normalizeCube", CG_SAMPLERCUBE);
  CGstate state = cgGetNamedSamplerState(context, "Texture");
  CGstateassignment sa = cgCreateSamplerStateAssignment(effectParam, state);
  CGbool ok = cgSetTextureStateAssignment(sa, value);

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

cgSetTextureStateAssignment was introduced in Cg 1.5.

SEE ALSO

cgSetSamplerStateAssignment