Tesselation

I am programming in C++ and have a problem when I try to tesselate irregular polygons. In the gluTessCallback routine everything is fine if I use OpenGL routines like glBegin, gl End or glVertex3dv. But if I try to create my own callback routine it won’t compile (using G++). It says the “function is not declared in this scope”.

THe compiler doesn’t like the callback function in the gluTessCallback routine or in its own declaration.

I have tried void* and CALLBACK* but neither works.

Should the callback function be a class member function? Or declared as a C style function?

Does anyone have a sample class I could use as a reference?

The callback should either be a static member, or a simple C style function.

For example :
void __stdcall tess_Begin(GLenum e) {
glBegin(e);
glNormal3d(tess_cbTessNormVctr[X], tess_cbTessNormVctr[Y], tess_cbTessNormVctr[Z]);
}



gluTessCallback ( pGLDvce->m_pTess, GLU_TESS_BEGIN, ( void ( __stdcall *) ( void )) tess_Begin);

Notes :

pGLDvce is my instance for the current opengl device, as my library supports many instances. (so the m_pTess is the result of a gluNewTess();

tess_cbTessNormVctr is a global holding the current normal vector for the current polygon being processed. (pre-calculated)

Hope this helps
Jason

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.