From dfd5a373905f98be1b5b65b01981d9f9b7ec56df Mon Sep 17 00:00:00 2001 From: clifford Date: Thu, 24 Sep 2009 08:40:34 +0000 Subject: [PATCH] Stefan Farthofer: Fixed glutess calls for win32 git-svn-id: http://svn.clifford.at/openscad/trunk@93 b57f626f-c46c-0410-a088-ec61d464b74c --- dxftess.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/dxftess.cc b/dxftess.cc index ba62329e..223ce1be 100644 --- a/dxftess.cc +++ b/dxftess.cc @@ -18,6 +18,12 @@ * */ +#ifdef WIN32 +# define STDCALL __stdcall +#else +# define STDCALL +#endif + #define INCLUDE_ABSTRACT_NODE_DETAILS #include "openscad.h" @@ -39,7 +45,7 @@ static int tess_count; static QVector tess_tri; static GLdouble *tess_p1, *tess_p2; -static void tess_vertex(void *vertex_data) +static void STDCALL tess_vertex(void *vertex_data) { GLdouble *p = (double*)vertex_data; #if 0 @@ -89,7 +95,7 @@ static void tess_vertex(void *vertex_data) tess_count++; } -static void tess_begin(GLenum type) +static void STDCALL tess_begin(GLenum type) { #if 0 if (type == GL_TRIANGLE_FAN) { @@ -106,12 +112,12 @@ static void tess_begin(GLenum type) tess_type = type; } -static void tess_end(void) +static void STDCALL tess_end(void) { /* nothing to be done here */ } -static void tess_error(GLenum errno) +static void STDCALL tess_error(GLenum errno) { PRINTF("GLU tesselation error %d!", errno); } @@ -158,10 +164,10 @@ void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, double h) { GLUtesselator *tobj = gluNewTess(); - gluTessCallback(tobj, GLU_TESS_VERTEX, (GLvoid(*)())&tess_vertex); - gluTessCallback(tobj, GLU_TESS_BEGIN, (GLvoid(*)())&tess_begin); - gluTessCallback(tobj, GLU_TESS_END, (GLvoid(*)())&tess_end); - gluTessCallback(tobj, GLU_TESS_ERROR, (GLvoid(*)())&tess_error); + gluTessCallback(tobj, GLU_TESS_VERTEX, (void(STDCALL *)())&tess_vertex); + gluTessCallback(tobj, GLU_TESS_BEGIN, (void(STDCALL *)())&tess_begin); + gluTessCallback(tobj, GLU_TESS_END, (void(STDCALL *)())&tess_end); + gluTessCallback(tobj, GLU_TESS_ERROR, (void(STDCALL *)())&tess_error); tess_tri.clear(); QList vl;