How to use the GLU tesselator call back


This is my first time to use the glu tesselator. The example code say the fowwling line of code will work:

gluTessCallback(myTess, GLU_TESS_BEGIN, glBegin);

But when I compile it I got an error message:
cannot convert parameter 3 from ‘void (unsigned int)’ to 'void (__stdcall *)(void).

What is wrong?

Can any body help?


Hi !

It means what the error says, you try to pass a void xxx(void) function, but it wants a void xxx( GLenum x) function.

So your functions needs to have a GLenum type added as an argument, this specifies the glBegin() type for the tesselation.