Name
cgGetProfileProperty - query property of a profile
Synopsis
#include <Cg/cg.h>
CGbool cgGetProfileProperty( CGprofile profile, CGenum query );
Parameters
- profile
-
The profile to query.
- query
-
An enumerant describing the property to be queried.
The following enumerants are allowed:
-
- CG_IS_OPENGL_PROFILE
- CG_IS_DIRECT3D_PROFILE
- CG_IS_DIRECT3D_8_PROFILE
- CG_IS_DIRECT3D_9_PROFILE
- CG_IS_DIRECT3D_10_PROFILE
- CG_IS_DIRECT3D_11_PROFILE
- CG_IS_VERTEX_PROFILE
- CG_IS_FRAGMENT_PROFILE
- CG_IS_GEOMETRY_PROFILE
- CG_IS_TESSELLATION_CONTROL_PROFILE
- CG_IS_TESSELLATION_EVALUATION_PROFILE
- CG_IS_TRANSLATION_PROFILE
- CG_IS_HLSL_PROFILE
- CG_IS_GLSL_PROFILE
Return Values
Returns CG_TRUE if profile holds the property expressed by query.
Returns CG_FALSE otherwise.
Description
cgGetProfileProperty returns property information about the given profile.
query must be one of the following enumerants :
- CG_IS_OPENGL_PROFILE
-
profile is an OpenGL profile.
- CG_IS_DIRECT3D_PROFILE
-
profile is Direct3D profile.
- CG_IS_DIRECT3D_8_PROFILE
-
profile is Direct3D8 profile.
- CG_IS_DIRECT3D_9_PROFILE
-
profile is Direct3D9 profile.
- CG_IS_DIRECT3D_10_PROFILE
-
profile is Direct3D10 profile.
- CG_IS_DIRECT3D_11_PROFILE
-
profile is Direct3D11 profile.
- CG_IS_VERTEX_PROFILE
-
profile is vertex profile.
- CG_IS_FRAGMENT_PROFILE
-
profile is fragment profile.
- CG_IS_GEOMETRY_PROFILE
-
profile is geometry profile.
- CG_IS_TESSELLATION_CONTROL_PROFILE
-
profile is tessellation control profile.
- CG_IS_TESSELLATION_EVALUATION_PROFILE
-
profile is tessellation evaluation profile.
- CG_IS_TRANSLATION_PROFILE
-
profile is a translation profile.
- CG_IS_HLSL_PROFILE
-
profile is an HLSL translation profile.
- CG_IS_GLSL_PROFILE
-
profile is a GLSL translation profile.
Examples
CGprofile profile;
int nProfiles;
int ii;
nProfiles = cgGetNumSupportedProfiles();
printf("NumSupportedProfiles: %i\n", nProfiles);
for (ii=0; ii<nProfiles; ++ii) {
profile = cgGetSupportedProfile(ii);
if (cgGetProfileProperty(profile, CG_IS_OPENGL_PROFILE)) {
printf("%s is an OpenGL profile\n", cgGetProfileString(profile));
} else {
printf("%s is not an OpenGL profile\n", cgGetProfileString(profile));
}
}
Errors
CG_INVALID_PARAMETER_ERROR is generated if profile is not supported
by this version of the Cg library.
CG_INVALID_ENUMERANT_ERROR is generated if query is not
CG_IS_OPENGL_PROFILE, CG_IS_DIRECT3D_PROFILE, CG_IS_DIRECT3D_8_PROFILE,
CG_IS_DIRECT3D_9_PROFILE, CG_IS_DIRECT3D_10_PROFILE,
CG_IS_DIRECT3D_11_PROFILE, CG_IS_VERTEX_PROFILE,
CG_IS_FRAGMENT_PROFILE, CG_IS_GEOMETRY_PROFILE, CG_IS_TESSELLATION_CONTROL_PROFILE,
CG_IS_TESSELLATION_EVALUATION_PROFILE, CG_IS_TRANSLATION_PROFILE,
CG_IS_HLSL_PROFILE, or CG_IS_GLSL_PROFILE
History
cgGetProfileProperty was introduced in Cg 2.2.
See Also
cgGetNumSupportedProfiles,
cgGetSupportedProfile,
cgIsProfileSupported,
cgGetProfileString,
cgGetProfile
|