PDA

View Full Version : Problems with Quadrics



jtipton
02-16-2006, 02:30 PM
I am having trouble registering a callback function for gluQuadricCallback. The definition states that it takes a paramterless function, but the documentation says that an error code will be passed to my function. The OpenGL example code "quadric.c" does not compile with the following error:

invalid conversion from `void(*)(unsigned int) 'to `GLvoid(*)()'

The method signature is as follows:

void errorCallback(GLenum error);

How do I get gluQuadricCallback to take a function pointer for this method.

Taylor Holliday
02-25-2006, 07:50 PM
You'll have to explicitly cast it:

gluQuadricCallback( quad, GLU_ERROR, ( GLvoid(*)() ) errorCallback);

- Taylor

jtipton
02-27-2006, 06:08 AM
Thank you for the response. The cast makes everything compile successfully. Is there a way to stress the GL so that I can cause a quadric error? I would like to check my error handling code, but don't know how to cause a quadric error. Why would the GL specification cause you to cast the function pointer instead of specifiying the correct signature?