From 04737e10ed0ad3942994179242a224142a5782c5 Mon Sep 17 00:00:00 2001 From: Peter Clifton Date: Sat, 24 Nov 2012 18:53:59 +0000 Subject: [PATCH] hidgl: Fixup signature gluTessCallback functions to work on Win32 On windows these callbacks are invoked using stdcall calling convention and we need to annotate then with the "CALLBACK" macro to achieve this. If we ever end up using glew.h, we can probably drop the #ifndef CALLBACK check which #defines CALLBACK to an empty string on other platforms. --- src/hid/common/hidgl.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/hid/common/hidgl.c b/src/hid/common/hidgl.c index 8c26fe8129..d9fb0adbe9 100644 --- a/src/hid/common/hidgl.c +++ b/src/hid/common/hidgl.c @@ -409,21 +409,17 @@ static GLenum tessVertexType; static int stashed_vertices; static int triangle_comp_idx; +#ifndef CALLBACK +#define CALLBACK +#endif -static void +static void CALLBACK myError (GLenum errno) { printf ("gluTess error: %s\n", gluErrorString (errno)); } -static void -myFreeCombined () -{ - while (combined_num_to_free) - free (combined_to_free [-- combined_num_to_free]); -} - -static void +static void CALLBACK myCombine ( GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **dataOut ) { #define MAX_COMBINED_VERTICES 2500 @@ -454,7 +450,7 @@ myCombine ( GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void ** *dataOut = new_vertex; } -static void +static void CALLBACK myBegin (GLenum type) { tessVertexType = type; @@ -464,7 +460,7 @@ myBegin (GLenum type) static double global_scale; -static void +static void CALLBACK myVertex (GLdouble *vertex_data) { static GLfloat triangle_vertices [2 * 3]; @@ -517,6 +513,13 @@ myVertex (GLdouble *vertex_data) printf ("Vertex received with unknown type\n"); } +static void +myFreeCombined () +{ + while (combined_num_to_free) + free (combined_to_free [-- combined_num_to_free]); +} + void hidgl_fill_polygon (int n_coords, Coord *x, Coord *y) { -- 2.11.4.GIT