mirror of
https://github.com/nigels-com/glew.git
synced 2025-07-01 19:17:41 +00:00
osmesa: Resolve compilation warnings
This commit is contained in:
parent
e1e8480902
commit
42a8e208f6
@ -5,7 +5,12 @@
|
||||
#if defined(GLEW_EGL)
|
||||
#include <GL/eglew.h>
|
||||
#elif defined(GLEW_OSMESA)
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#include <GL/osmesa.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <GL/wglew.h>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
include config/Makefile.linux
|
||||
|
||||
LDFLAGS.GL = -lOSMesa
|
||||
CFLAGS.EXTRA += -DGLEW_OSMESA
|
||||
CFLAGS.EXTRA += -DGLEW_OSMESA -Wno-cast-function-type
|
||||
|
@ -36,6 +36,9 @@
|
||||
#include <GL/glew.h>
|
||||
#if defined(GLEW_OSMESA)
|
||||
#define GLAPI extern
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#include <GL/osmesa.h>
|
||||
#elif defined(GLEW_EGL)
|
||||
#include <GL/eglew.h>
|
||||
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user