Name
cgGLGetGLSLVersion - get the GLSL version enumerant from a string
Synopsis
#include <Cg/cgGL.h>
CGGLglslversion cgGLGetGLSLVersion(const char *version_string);
Parameters
- version_string
-
A string containing the GLSL version name.
Return Values
Returns the CGGLglslversion enumerant associated with version_string.
Returns CG_GL_GLSL_DEFAULT if an error occurs.
Description
cgGLGetGLSLVersion returns the CGGLglslversion enumerant from a string.
Examples
CGGLglslversion v100 = cgGLGetGLSLVersion("1");
CGGLglslversion v110 = cgGLGetGLSLVersion("1.1");
CGGLglslversion v120 = cgGLGetGLSLVersion("1.20");
CGGLglslversion vFoo = cgGLGetGLSLVersion("foo");
assert(v100=CG_GL_GLSL_100);
assert(v110=CG_GL_GLSL_110);
assert(v120=CG_GL_GLSL_120);
assert(vFoo=CG_GL_GLSL_DEFAULT);
Errors
CG_INVALID_PARAMETER_ERROR is generated if version_string is NULL.
History
cgGLGetGLSLVersion was introduced in Cg 3.1.
See Also
cgGLGetGLSLVersionString,
cgGLGetContextGLSLVersion,
cgGLSetContextGLSLVersion
|