Cg Core Runtime API cgValidateTechnique(3)
NAME
cgValidateTechnique - validate a technique from an effect
SYNOPSIS
#include
CGbool cgValidateTechnique( CGtechnique tech );
PARAMETERS
tech The technique handle to validate.
RETURN VALUES
Returns CGTRUE if all of the state assignments in all of
the passes in tech are valid and can be used on the current
hardware.
Returns CGFALSE 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, NUL);
CGtechnique tech = cgGetFirstTechnique(effect);
while (tech && cgValidateTechnique(tech) == CGFALSE) {
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);
}
ERORS
CGINVALIDTECHNIQUEHANDLEROR is generated if tech is
not a valid technique.
HISTORY
cgValidateTechnique was introduced in Cg 1.4.
Cg Toolkit 2.1 Last change: 1
Cg Core Runtime API cgValidateTechnique(3)
SEE ALSO
cgCallStateValidateCallback, cgSetStateCallbacks
Cg Toolkit 2.1 Last change: 2
|