Name
cgValidateTechnique - validate a technique from an effect
Synopsis
#include <Cg/cg.h>
CGbool cgValidateTechnique( CGtechnique tech );
Parameters
- tech
-
The technique handle to validate.
Return Values
Returns CG_TRUE if all of the state assignments
in all of the passes in tech are valid and can be used on the
current hardware.
Returns CG_FALSE if any state assignment fails validation, or if an
error occurs.
Description
cgValidateTechnique iterates over all of the passes of a technique and
tests to see if every state assignment in the pass passes validation.
Examples
CGcontext context = cgCreateContext();
CGeffect effect = cgCreateEffectFromFile(context, filename, NULL);
CGtechnique tech = cgGetFirstTechnique(effect);
while (tech && cgValidateTechnique(tech) == CG_FALSE) {
fprintf(stderr, "Technique %s did not validate. Skipping.\n",
cgGetTechniqueName(tech));
tech = cgGetNextTechnique(tech);
}
if (tech) {
fprintf(stderr, "Using technique %s.\n", cgGetTechniqueName(tech));
} else {
fprintf(stderr, "No valid technique found\n");
exit(1);
}
Errors
CG_INVALID_TECHNIQUE_HANDLE_ERROR is generated if tech is not a valid technique.
History
cgValidateTechnique was introduced in Cg 1.4.
See Also
cgCallStateValidateCallback,
cgSetStateCallbacks
|