PDA

View Full Version : gluTessCallback function



pifaf
07-04-2001, 10:15 PM
Hi u all:
English is not my native language, so I wish u could understand me.

I'm traying to draw a irregular polygon using the Tess functions, but I have got this warning everytime :

'gluTessCallback' : cannot convert parameter 3 from 'void (unsigned int)' to 'void (__stdcall *)(void)'


The code is :
gluTessCallback(tess, GLU_BEGIN, glBegin);

I'm using Visual C++ 5.0.

I have tried to cast it in several ways,but I think I'm not so good in C.

Thanks.
PIFAF

DreamGL
07-05-2001, 04:09 AM
[
The code is :
gluTessCallback(tess, GLU_BEGIN, glBegin);

Your third paramter shoud be a function somthing like

gluTessCallback(texx, GLU_BEGIN, function );

where

void function(){

// your coder here

}

do not forget to declare it in your .h file, if you have some

pifaf
07-06-2001, 12:06 AM
Thanks for ur atenction, DreamGL,but it wasn't the answer i was expecting.

I'm triying to compile a piece of code from Open GL Super Bible.The code complete is :
tess = gluNewTess();
gluTessCallback(tess, GLU_BEGIN, glbegin);
gluTessCallback(tess, GLU_VERTEX, glVertex3dv);
gluTessCallback(tess, GLU_END, glEnd);
gluBeginPolygon(tess);
gluTessVertex(tess, outside[0], outside[0]);
gluTessVertex(tess, outside[1], outside[1]);
gluTessVertex(tess, outside[2], outside[2]);
gluTessVertex(tess, outside[3], outside[3]);
gluTessVertex(tess, outside[4], outside[4]);
gluTessVertex(tess, outside[5], outside[5]);
gluTessVertex(tess, outside[6], outside[6]);
gluNextContour(tess, GLU_INTERIOR);
gluTessVertex(tess, inside[0], inside[0]);
gluTessVertex(tess, inside[1], inside[1]);
gluTessVertex(tess, inside[2], inside[2]);
gluEndPolygon(tess);
gluDeleteTess(tess);


But I have got the warning : error C2664: 'gluTessCallback' : cannot convert parameter 3 from 'void (unsigned int)' to 'void (__stdcall *)(void)'

at the two first lines with gluTessCallback.I supossed it means a problem with the cast of the funtion,but i haven't been able to do.
Any idea??
Thanks

mamali
10-04-2005, 07:46 AM
cast your function with:
(void (CALLBACK *)())