View Full Version : how to use gluTessCallback function in c++?

09-01-2000, 08:48 AM
my problem is :
will get error in c++ compiler.

error mssages is:
'gluTessCallback' : cannot convert parameter 3 from 'void *' to 'void (__stdcall *)(void)'

'gluTessCallback' : cannot convert parameter 3 from 'void (const double *)' to 'void (__stdcall *)(void)'

I compile it in c without any problem.

plz help me!

11-04-2000, 04:14 PM
Hi there,
I was having the exact same problem as you when trying to use tessellation in my VC++/MFC program, but I found a fix to it from another discussion board. Here it a fix:

GLUtesselator *tess;
tess = gluNewTess();
typedef void (__stdcall * TessFuncPtr)( );

gluTessCallback(tess, GLU_TESS_BEGIN, (TessFuncPtr)glBegin);
gluTessCallback(tess, GLU_TESS_END, (TessFuncPtr)glEnd);
gluTessCallback(tess, GLU_TESS_VERTEX, (TessFuncPtr)glVertex3dv);

Try it and see if it works in your VC++, unless you already found a fix.
BTW, that's as far as I got with tessellation, I'm getting linking error for the next immediate thing of using gluTessBeginPolygon() and gluTessBeginContour(). The error I get is as follows:

ACMPDoc.obj : error LNK2001: unresolved external symbol _gluTessBeginPolygon@8

Any ideas? Please.

p.s. I am not registered yet but will soon (right after this reply). Look for me, JDD, if you have any advice on OpenGL and tessellation or VC++ in general. Look forward to your reply soon.