First, you will need a callback. Cg will call this function whenver there is an error. Example:
void MyErrorCallback(void) {
CGerror error = cgGetError();
const char* errorString = cgGetErrorString(cgGetError());
printf("Cg error: %s\n", errorString);
// check for compiler errors
if (error == CG_COMPILER_ERROR)
printf("%s\n", cgGetLastListing(context));
}
Next, you need to set the callback:
cgSetErrorCallback(MyErrorCallback);
Now you should get more useful output when Cg has problems.
No comments:
Post a Comment