Cg Toolkit Cg 3.1 Toolkit Documentation
Cg / Runtime / CgGL / cgGLSetStateMatrixParameter

Name

cgGLSetStateMatrixParameter - set the values of a matrix parameter to a matrix in the OpenGL state

Synopsis

#include <Cg/cgGL.h>

void cgGLSetStateMatrixParameter( CGparameter param,
                                  CGGLenum matrix,
                                  CGGLenum transform );

Parameters

param
The matrix parameter that will be set.
matrix
An enumerant indicating which matrix should be retrieved from the OpenGL state. Must be one of the following :
  • CG_GL_MODELVIEW_MATRIX
  • CG_GL_PROJECTION_MATRIX
  • CG_GL_TEXTURE_MATRIX
  • CG_GL_MODELVIEW_PROJECTION_MATRIX
transform
An enumerant indicating an optional transformation that may be applied to the matrix before it is set. Must be one of the following :
  • CG_GL_MATRIX_IDENTITY
  • CG_GL_MATRIX_TRANSPOSE
  • CG_GL_MATRIX_INVERSE
  • CG_GL_MATRIX_INVERSE_TRANSPOSE

Return Values

None.

Description

cgGLSetStateMatrixParameter sets a matrix parameter to the values retrieved from an OpenGL state matrix. The state matrix to retrieve is indicated by matrix, which may be one of the following :

CG_GL_MODELVIEW_MATRIX
Get the current modelview matrix.
CG_GL_PROJECTION_MATRIX
Get the current projection matrix.
CG_GL_TEXTURE_MATRIX
Get the current texture matrix.
CG_GL_MODELVIEW_PROJECTION_MATRIX
Get the concatenated modelview and projection matrices.

The transform parameter specifies an optional transformation which will be applied to the retrieved matrix before setting the values in the parameter. transform must be one of the following :

CG_GL_MATRIX_IDENTITY
Don't apply any transform, leaving the matrix as is.
CG_GL_MATRIX_TRANSPOSE
Transpose the matrix.
CG_GL_MATRIX_INVERSE
Invert the matrix.
CG_GL_MATRIX_INVERSE_TRANSPOSE
Transpose and invert the matrix.

cgGLSetStateMatrixParameter may only be called with a uniform matrix parameter. If the size of the matrix is less than 4x4, the upper left corner of the matrix that fits into the given matrix parameter will be returned.

Examples

to-be-written

Errors

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

CG_NOT_MATRIX_PARAM_ERROR is generated if param is not a matrix parameter.

CG_INVALID_ENUMERANT_ERROR is generated if either matrix or transform is not one of the allowed enumerant values.

CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.

CG_INVALID_PARAMETER_ERROR is generated if the parameter fails to set for any other reason.

History

cgGLSetStateMatrixParameter was introduced in Cg 1.1.

See Also

cgGLSetMatrixParameter, cgGLGetMatrixParameter


Cg Toolkit | Cg Toolkit | Download | Release Archive | Profiles | Reference | Books | Discussions |


Cg Runtime CgGL

cgGLBindProgram
cgGLCreateBufferFromObject
cgGLCreateBuffer
cgGLDetectGLSLVersion
cgGLDisableClientState
cgGLDisableProfile
cgGLDisableProgramProfiles
cgGLDisableTextureParameter
cgGLEnableClientState
cgGLEnableProfile
cgGLEnableProgramProfiles
cgGLEnableTextureParameter
cgGLGetBufferObject
cgGLGetContextGLSLVersion
cgGLGetContextOptimalOptions
cgGLGetGLSLVersion
cgGLGetGLSLVersionString
cgGLGetLatestProfile
cgGLGetManageTextureParameters
cgGLGetMatrixParameterArraydc
cgGLGetMatrixParameterArraydr
cgGLGetMatrixParameterArrayfc
cgGLGetMatrixParameterArrayfr
cgGLGetMatrixParameterArray
cgGLGetMatrixParameterdc
cgGLGetMatrixParameterdr
cgGLGetMatrixParameterfc
cgGLGetMatrixParameterfr
cgGLGetMatrixParameter
cgGLGetOptimalOptions
cgGLGetParameter1d
cgGLGetParameter1f
cgGLGetParameter2d
cgGLGetParameter2f
cgGLGetParameter3d
cgGLGetParameter3f
cgGLGetParameter4d
cgGLGetParameter4f
cgGLGetParameterArray1d
cgGLGetParameterArray1f
cgGLGetParameterArray2d
cgGLGetParameterArray2f
cgGLGetParameterArray3d
cgGLGetParameterArray3f
cgGLGetParameterArray4d
cgGLGetParameterArray4f
cgGLGetParameterArray
cgGLGetParameter
cgGLGetProgramID
cgGLGetTextureEnum
cgGLGetTextureParameter
cgGLIsProfileSupported
cgGLIsProgramLoaded
cgGLLoadProgram
cgGLRegisterStates
cgGLSetContextGLSLVersion
cgGLSetContextOptimalOptions
cgGLSetDebugMode
cgGLSetManageTextureParameters
cgGLSetMatrixParameterArraydc
cgGLSetMatrixParameterArraydr
cgGLSetMatrixParameterArrayfc
cgGLSetMatrixParameterArrayfr
cgGLSetMatrixParameterArray
cgGLSetMatrixParameterdc
cgGLSetMatrixParameterdr
cgGLSetMatrixParameterfc
cgGLSetMatrixParameterfr
cgGLSetMatrixParameter
cgGLSetOptimalOptions
cgGLSetParameter1d
cgGLSetParameter1dv
cgGLSetParameter1f
cgGLSetParameter1fv
cgGLSetParameter2d
cgGLSetParameter2dv
cgGLSetParameter2f
cgGLSetParameter2fv
cgGLSetParameter3d
cgGLSetParameter3dv
cgGLSetParameter3f
cgGLSetParameter3fv
cgGLSetParameter4d
cgGLSetParameter4dv
cgGLSetParameter4f
cgGLSetParameter4fv
cgGLSetParameterArray1d
cgGLSetParameterArray1f
cgGLSetParameterArray2d
cgGLSetParameterArray2f
cgGLSetParameterArray3d
cgGLSetParameterArray3f
cgGLSetParameterArray4d
cgGLSetParameterArray4f
cgGLSetParameterArray
cgGLSetParameter
cgGLSetParameterPointer
cgGLSetStateMatrixParameter
cgGLSetTextureParameter
cgGLSetupSampler
cgGLUnbindProgram
cgGLUnloadProgram