View Full Version : gluTessCallback mystery

01-17-2004, 12:24 AM

When I register my own functions with gluTessCallback I have to cast them:

typedef void (__stdcall * TessFuncPtr)( );
gluTessCallback( ..., (TessFuncPtr) ..);

Otherwise I get a compilation error.

When I register library functions (eg. glBegin(), glVertex3dv(), ...) I don't have to cast it to get the code to compile.

As far as I can tell, my functions have exactly the same signature as the corresponding library function.

Can anyone please explain this to me?

Btw, I'm compiling with gcc/3.3.1 under Cygwin.

01-17-2004, 01:35 AM
The default calling convention in C and C++ is __cdecl, but the Win32 API, and that includes OpenGL, uses __stdcall.

01-17-2004, 01:43 AM
Ah! I see. Thanks a bunch for clearing that up.