Cg Toolkit Cg 3.1 Toolkit Documentation
Cg / Runtime / CgGL / cgGLGetLatestProfile

Name

cgGLGetLatestProfile - get the latest profile for a profile class

Synopsis

#include <Cg/cgGL.h>

CGprofile cgGLGetLatestProfile( CGGLenum profileClass );

Parameters

profileClass
The class of profile that will be returned. Must be one of the following :
  • CG_GL_VERTEX
  • CG_GL_GEOMETRY
  • CG_GL_FRAGMENT
  • CG_GL_TESSELLATION_CONTROL
  • CG_GL_TESSELLATION_EVALUATION

Return Values

Returns a profile enumerant for the latest profile of the given class.

Returns CG_PROFILE_UNKNOWN if no appropriate profile is available or an error occurs.

Description

cgGLGetLatestProfile returns the best available profile of a given class. The OpenGL extensions are checked to determine the best profile which is supported by the current GPU, driver, and cgGL library combination.

profileClass may be one of the following enumerants :

CG_GL_VERTEX
The latest available vertex profile will be returned.
CG_GL_GEOMETRY
The latest available geometry profile will be returned.
CG_GL_FRAGMENT
The latest available fragment profile will be returned.
CG_GL_TESSELLATION_CONTROL
The latest available tessellation control profile will be returned.
CG_GL_TESSELLATION_EVALUATION
The latest available tessellation evaluation profile will be returned.

cgGLGetLatestProfile can be used in conjuction with cgCreateProgram to ensure that more optimal profiles are used as they are made available, even though they might not have been available at compile time or with a different version of the runtime.

Starting in Cg 2.2, certain environment variables can override the value returned by cgGLGetLatestProfile:

If cgGLGetLatestProfile is called with profileClass being CG_GL_VERTEX and an environment variable named CGGL_LATEST_VERTEX_PROFILE is set in the application's environment to a string that cgGetProfile translates to a valid profile (meaning not CG_PROFILE_UNKNOWN), the CGprofile value returned by cgGetProfile is returned by cgGLGetLatestProfile.

If cgGLGetLatestProfile is called with profileClass being CG_GL_GEOMETRY and an environment variable named CGGL_LATEST_GEOMETRY_PROFILE is set in the application's environment to a string that cgGetProfile translates to a valid profile (meaning not CG_PROFILE_UNKNOWN), the CGprofile value returned by cgGetProfile is returned by cgGLGetLatestProfile.

If cgGLGetLatestProfile is called with profileClass being CG_GL_FRAGMENT and an environment variable named CGGL_LATEST_FRAGMENT_PROFILE is set in the application's environment to a string that cgGetProfile translates to a valid profile (meaning not CG_PROFILE_UNKNOWN), the CGprofile value returned by cgGetProfile is returned by cgGLGetLatestProfile.

If cgGLGetLatestProfile is called with profileClass being CG_GL_TESSELLATION_CONTROL and an environment variable named CGGL_LATEST_TESSELLATION_CONTROL_PROFILE is set in the application's environment to a string that cgGetProfile translates to a valid profile (meaning not CG_PROFILE_UNKNOWN), the CGprofile value returned by cgGetProfile is returned by cgGLGetLatestProfile.

If cgGLGetLatestProfile is called with profileClass being CG_GL_TESSELLATION_EVALUATION and an environment variable named CGGL_LATEST_TESSELLATION_EVALUATION_PROFILE is set in the application's environment to a string that cgGetProfile translates to a valid profile (meaning not CG_PROFILE_UNKNOWN), the CGprofile value returned by cgGetProfile is returned by cgGLGetLatestProfile.

Examples

/* Output information about available profiles */
printf("vertex profile:   %s\n",
       cgGetProfileString(cgGLGetLatestProfile(CG_GL_VERTEX)));
printf("geometry profile: %s\n",
       cgGetProfileString(cgGLGetLatestProfile(CG_GL_GEOMETRY)));
printf("fragment profile: %s\n",
       cgGetProfileString(cgGLGetLatestProfile(CG_GL_FRAGMENT)));
printf("tessellation control profile: %s\n",
       cgGetProfileString(cgGLGetLatestProfile(CG_GL_TESSELLATION_CONTROL)));
printf("tessellation evalutation profile: %s\n",
       cgGetProfileString(cgGLGetLatestProfile(CG_GL_TESSELLATION_EVALUATION)));

Errors

CG_INVALID_ENUMERANT_ERROR is generated if profileClass is not CG_GL_VERTEX, CG_GL_GEOMETRY, CG_GL_FRAGMENT, CG_GL_TESSELLATION_CONTROL, or CG_GL_TESSELLATION_EVALUATION.

History

cgGLGetLatestProfile was introduced in Cg 1.1.

CG_GL_GEOMETRY support was introduced in Cg 2.0.

CG_GL_TESSELLATION_CONTROL and CG_GL_TESSELLATION_EVALUATION support was introduced in Cg 3.0.

See Also

cgGLSetOptimalOptions, cgCreateProgram


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