PDA

View Full Version : How to use "gluTessCallback" in c++



cell
07-13-2003, 03:57 PM
After i compile my c++ program(in VC.NET and VC6), i get 2 errors,
codes:
gluTessCallback(tess, GLU_BEGIN, glBegin);
gluTessCallback(tess, GLU_VERTEX, glVertex3dv);

errors:
:error C2664: 'gluTessCallback' : cannot convert parameter 3 from 'void (unsigned int)' to 'void (__stdcall *)(void)'None of the functions with this name in scope match the target type
:error C2664: 'gluTessCallback' : cannot convert parameter 3 from 'void (const double *)' to 'void (__stdcall *)(void)'None of the functions with this name in scope match the target type

Please help me!

Relic
07-13-2003, 04:38 PM
Quick and dirty:
gluTessCallback(tess, GLU_BEGIN, (void (__stdcall *)(void)) glBegin);
gluTessCallback(tess, GLU_VERTEX, (void (__stdcall *) (void)) glVertex3dv);
A cleaner option would be to create wrapper functions with the exact prototype.

cell
07-13-2003, 11:00 PM
it can go,
thanks for your help!

cell
07-13-2003, 11:03 PM
And thanks for your advice.