NAME

cgGLSetupSampler - initializes a sampler's state and texture object handle

SYNOPSIS

  #include <Cg/cgGL.h>

  void cgGLSetupSampler(CGparameter param, GLuint texobj);

PARAMETERS

param

Specifies the sampler that will be set.

texobj

An OpenGL texture object name. This is the value the parameter will be set to.

DESCRIPTION

cgGLSetupSampler initializes a sampler; like cgGLSetTextureParameter, it informs the OpenGL Cg runtime which OpenGL texture object to associate with the sampler. Furthermore, if the sampler was defined in the source file with a sampler_state block that specifies sampler state, this sampler state is initialized for the given texture object.

Note that in order to use the texture, either cgGLEnableTextureParameter must be called after cgGLSetTextureParameter and before the geometry is drawn, or cgGLSetManageTextureParameters must be called with a value of CG_TRUE.

RETURN VALUES

cgGLSetupSampler does not return any values.

ERRORS

CG_INVALID_PROFILE_ERROR is generated if param's profile is not a supported OpenGL profile.

CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter handle.

CG_INVALID_PARAMETER_ERROR is generated param is not a texture parameter or if the parameter fails to set for any other reason.

SEE ALSO

cgGLSetTextureParameter, cgGLGetTextureParameter, and cgGLSetManageTextureParameters