Archived

This topic is now archived and is closed to further replies.

MatthewPL

How to register gluTessCallback properly?

Recommended Posts

Hi all! I''m very new and I''m third day looking for code example with Tesselation in BCB4.0. I found few interesting examples but its give me compiler error. Even RedBook, or SuperBiblle code doesn''t work. I am given these errors: E2034 Cannot convert ''void (__stdcall *)(unsigned int)'' to ''void (__stdcall *)()''. E2343 Type mismatch in parameter ''fn'' in call to ''__stdcall gluTessCallback(GLUtesselator *,unsigned int,void (__stdcall *)())''. I know this is because I can''t properly call glBegin and glVertex in: gluTessCallback(tess, GLU_BEGIN, glBegin); gluTessCallback(tess, GLU_TESS_VERTEX, glVertex3dv); But this line is ok: gluTessCallback(tess, GLU_TESS_END, glEnd); Does anyone can send me a very little, but working, Borland C++ Builder 4.0 (or 5.0) project? Thanks for any help Matthew

Share this post


Link to post
Share on other sites
Try:

  

#include <GL/glu.h>

#define GLCALLBACK __stdcall

typedef void (GLCALLBACK *GluTessCallbackType)();


// PROTOTYPE

void GLCALLBACK BeginCB( GLenum type );

// CODE

gluTessCallback( tess, GLU_TESS_BEGIN, (GluTessCallbackType)BeginCB );

// FUNCTION

void
GLCALLBACK BeginCB( GLenum type ) {
}

Share this post


Link to post
Share on other sites