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

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 :

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.

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)));

ERRORS

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

HISTORY

cgGLGetLatestProfile was introduced in Cg 1.1.

CG_GL_GEOMETRY support was introduced in Cg 2.0.

SEE ALSO

cgGLSetOptimalOptions, cgCreateProgram