mirror of
https://github.com/nigels-com/glew.git
synced 2025-07-02 03:27:41 +00:00
osmesa: Resolve compilation warnings
This commit is contained in:
parent
e1e8480902
commit
42a8e208f6
@ -5,7 +5,12 @@
|
|||||||
#if defined(GLEW_EGL)
|
#if defined(GLEW_EGL)
|
||||||
#include <GL/eglew.h>
|
#include <GL/eglew.h>
|
||||||
#elif defined(GLEW_OSMESA)
|
#elif defined(GLEW_OSMESA)
|
||||||
|
#ifndef GLAPI
|
||||||
#define GLAPI extern
|
#define GLAPI extern
|
||||||
|
#endif
|
||||||
|
#ifndef APIENTRY
|
||||||
|
#define APIENTRY
|
||||||
|
#endif
|
||||||
#include <GL/osmesa.h>
|
#include <GL/osmesa.h>
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
#include <GL/wglew.h>
|
#include <GL/wglew.h>
|
||||||
|
@ -315,13 +315,15 @@ static GLubyte *osmPixels = NULL;
|
|||||||
|
|
||||||
GLboolean glewCreateContext (struct createParams *params)
|
GLboolean glewCreateContext (struct createParams *params)
|
||||||
{
|
{
|
||||||
|
(void) params; /* not used */
|
||||||
|
|
||||||
ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
|
ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
|
||||||
if (NULL == ctx) return GL_TRUE;
|
if (NULL == ctx) return GL_TRUE;
|
||||||
if (NULL == osmPixels)
|
if (NULL == osmPixels)
|
||||||
{
|
{
|
||||||
osmPixels = (GLubyte *) calloc(osmWidth*osmHeight*4, 1);
|
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;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
include config/Makefile.linux
|
include config/Makefile.linux
|
||||||
|
|
||||||
LDFLAGS.GL = -lOSMesa
|
LDFLAGS.GL = -lOSMesa
|
||||||
CFLAGS.EXTRA += -DGLEW_OSMESA
|
CFLAGS.EXTRA += -DGLEW_OSMESA -Wno-cast-function-type
|
||||||
|
@ -36,6 +36,9 @@
|
|||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
#if defined(GLEW_OSMESA)
|
#if defined(GLEW_OSMESA)
|
||||||
#define GLAPI extern
|
#define GLAPI extern
|
||||||
|
#ifndef APIENTRY
|
||||||
|
#define APIENTRY
|
||||||
|
#endif
|
||||||
#include <GL/osmesa.h>
|
#include <GL/osmesa.h>
|
||||||
#elif defined(GLEW_EGL)
|
#elif defined(GLEW_EGL)
|
||||||
#include <GL/eglew.h>
|
#include <GL/eglew.h>
|
||||||
@ -1028,7 +1031,7 @@ GLboolean CreateContext (GLContext* ctx)
|
|||||||
{
|
{
|
||||||
osmPixels = (GLubyte *) calloc(osmWidth*osmHeight*4, 1);
|
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;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user