diff --git a/auto/src/glewinfo_head.c b/auto/src/glewinfo_head.c index 0f7e672..11b9f58 100644 --- a/auto/src/glewinfo_head.c +++ b/auto/src/glewinfo_head.c @@ -5,7 +5,12 @@ #if defined(GLEW_EGL) #include #elif defined(GLEW_OSMESA) +#ifndef GLAPI #define GLAPI extern +#endif +#ifndef APIENTRY +#define APIENTRY +#endif #include #elif defined(_WIN32) #include diff --git a/auto/src/glewinfo_tail.c b/auto/src/glewinfo_tail.c index 4273c97..765de74 100644 --- a/auto/src/glewinfo_tail.c +++ b/auto/src/glewinfo_tail.c @@ -315,13 +315,15 @@ static GLubyte *osmPixels = NULL; GLboolean glewCreateContext (struct createParams *params) { + (void) params; /* not used */ + ctx = OSMesaCreateContext(OSMESA_RGBA, NULL); if (NULL == ctx) return GL_TRUE; if (NULL == osmPixels) { osmPixels = (GLubyte *) calloc(osmWidth*osmHeight*4, 1); } - if (!OSMesaMakeCurrent(ctx, osmPixels, GL_UNSIGNED_BYTE, osmWidth, osmHeight)) + if (!OSMesaMakeCurrent(ctx, osmPixels, osmFormat, osmWidth, osmHeight)) { return GL_TRUE; } diff --git a/config/Makefile.linux-osmesa b/config/Makefile.linux-osmesa index c957872..98e51b2 100644 --- a/config/Makefile.linux-osmesa +++ b/config/Makefile.linux-osmesa @@ -1,4 +1,4 @@ include config/Makefile.linux LDFLAGS.GL = -lOSMesa -CFLAGS.EXTRA += -DGLEW_OSMESA +CFLAGS.EXTRA += -DGLEW_OSMESA -Wno-cast-function-type diff --git a/src/visualinfo.c b/src/visualinfo.c index 6620fd1..e5e574e 100644 --- a/src/visualinfo.c +++ b/src/visualinfo.c @@ -36,6 +36,9 @@ #include #if defined(GLEW_OSMESA) #define GLAPI extern +#ifndef APIENTRY +#define APIENTRY +#endif #include #elif defined(GLEW_EGL) #include @@ -1028,7 +1031,7 @@ GLboolean CreateContext (GLContext* ctx) { osmPixels = (GLubyte *) calloc(osmWidth*osmHeight*4, 1); } - if (!OSMesaMakeCurrent(ctx->ctx, osmPixels, GL_UNSIGNED_BYTE, osmWidth, osmHeight)) + if (!OSMesaMakeCurrent(ctx->ctx, osmPixels, osmFormat, osmWidth, osmHeight)) { return GL_TRUE; }