PDA

View Full Version : How to use Callback fuction in gluTessCallback?



yszhang
02-16-2004, 09:29 PM
Using Visual C++ 6.0, I attempted to compile a tessellation example with texturing. I am using the Visual C++ 6.0 compiler. When it tries to compile a gluTessCallback(tobj, GLU_TESS_VERTEX, (void (CALLBACK *)())Vertex ) statement, I get an error :
"error C2664: 'gluTessCallback' : cannot convert parameter 3 from 'void (void *)' to 'void (__stdcall *)(void)'
None of the functions with this name in scope match the target type"
here,"Vertex" in the statement is a Callback function defined by me:
void CSceneView::Vertex(void *xyz)
{
glTexCoord2dv((double*)xyz + 3);
glVertex3dv((double*)xyz);
}

The same code will compile and run fine using the C compiler. Has anyone encountered this problem? Please help me!

Tom Nuydens
02-17-2004, 12:52 AM
Moving to beginners forum...

-- Tom