cgGLGetGLSLVersion
Keywords: cgGLGetGLSLVersion, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## 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.

> ## 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 and the return value is CG_GL_GLSL_DEFAULT if version_string is NULL.

> ## History

> cgGLGetGLSLVersion was introduced in Cg 3.1.

> ## See Also

> cgGLGetGLSLVersionString, cgGLGetContextGLSLVersion, cgGLSetContextGLSLVersion