mirror of
				https://github.com/nigels-com/glew.git
				synced 2025-11-04 06:15:02 +00:00 
			
		
		
		
	osmesa: Resolve compilation warnings
This commit is contained in:
		
							parent
							
								
									3da315c23a
								
							
						
					
					
						commit
						36084ea18b
					
				@ -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>
 | 
			
		||||
 | 
			
		||||
@ -314,13 +314,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>
 | 
			
		||||
@ -1027,7 +1030,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