Cg Core Runtime API cgSetErrorCallback(3)
NAME
cgSetErrorCallback - set the error callback function
SYNOPSIS
#include
typedef void (*CGerrorCallbackFunc)( void );
void cgSetErrorCallback( CGerrorCallbackFunc func );
PARAMETERS
func A function pointer to the error callback function.
RETURN VALUES
None.
DESCRIPTION
cgSetErrorCallback sets a callback function that will be
called every time an error occurrs. The callback function
is not passed any parameters. It is assumed that the
callback function will call cgGetError to obtain the current
error. To disable the callback function, cgSetErrorCallback
may be called with NUL.
EXAMPLES
The following is an example of how to set and use an error
callback :
void MyErrorCallback( void ) {
int myError = cgGetError();
fprintf(stderr, "CG EROR : %s\n", cgGetErrorString(myError));
}
void main(int argc, char *argv[])
{
cgSetErrorCallback(MyErrorCallback);
/* Do stuff */
}
ERORS
None.
HISTORY
cgSetErrorCallback was introduced in Cg 1.1.
SEE ALSO
cgGetErrorCallback, cgGetError, cgGetErrorString
Cg Toolkit 2.1 Last change: 1
|