Name
cgGetProgramDomainProfile - get the profile associated with a domain
Synopsis
#include <Cg/cg.h>
CGprofile cgGetProgramDomainProfile( CGprogram program,
int index );
Parameters
- program
-
The handle of the combined program object.
- index
-
The index of the program's domain to be queried.
Return Values
Returns the profile enumerant for the program with the given domain index, specifically one of:
CG_UNKNOWN_DOMAIN
CG_VERTEX_DOMAIN
CG_FRAGMENT_DOMAIN
CG_GEOMETRY_DOMAIN
Returns CG_PROFILE_UNKNOWN if an error occurs.
Description
cgGetProgramDomainProfile gets the profile of the passed combined program using the index to select which domain to choose.
Examples
/* This will enable all profiles for each domain in glslComboProgram */
int domains = cgGetProgramDomains(glslComboProgram);
for (int i=0; i<domains; i++) {
cgGLEnableProfile( cgGetProgramDomainProfile(glslComboProgram, i) );
}
/* This will enable the profile for the first program domain */
/* in glslComboProgram */
cgGLEnableProfile( cgGetProgramDomainProfile(glslComboProgram, 0) );
Errors
CG_INVALID_PROGRAM_HANDLE_ERROR is generated if program
is not a valid program handle.
CG_INVALID_PARAMETER_ERROR is generated if index is less than 0 or
greater than or equal to the number of domains in program.
History
cgGetProgramDomainProfile was introduced in Cg 1.5.
See Also
cgGetNumProgramDomains,
cgGetProfileDomain
|