Name
cgGLSetContextGLSLVersion - set the current GLSL version for a context
Synopsis
#include <Cg/cgGL.h> void cgGLSetContextGLSLVersion( CGcontext context, CGGLglslversion version );Parameters
- context
- The context in which the GLSL version will be changed.
- version
- The GLSL version to be used by the runtime for context. See the glsl documentation for further details.
Return Values
None.
Description
cgGLSetContextGLSLVersion sets the current GLSL version for a context. This version will be sent as a profile option when compiling programs or effects for GLSL profiles.
If an environment variable named
CGGL_GLSL_VERSION
is set in the application's environment to a string that translates to a valid, suppported GLSL version then cgGLSetContextGLSLVersion is effectively a noop as the GLSL version specified byCGGL_GLSL_VERSION
is always used instead of version and will always be returned by cgGLGetContextGLSLVersion. Valid values forCGGL_GLSL_VERSION
are "100", "110", "120", "1.00", "1.10", and "1.20". IfCGGL_GLSL_VERSION
is set to any other value it is ignored.Examples
to-be-written
Errors
CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.
CG_INVALID_ENUMERANT_ERROR is generated if version is not CG_GL_GLSL_DEFAULT, CG_GL_GLSL_100, CG_GL_GLSL_110 or CG_GL_GLSL_120.
History
cgGLSetContextGLSLVersion was introduced in Cg 3.1.
See Also
cgGLGetContextGLSLVersion, cgGLDetectGLSLVersion, cgGLGetContextOptimalOptions, cgGLSetContextOptimalOptions