mirror of
https://github.com/nigels-com/glew.git
synced 2024-12-01 01:57:08 +00:00
More refinements for OSMesa support - still not working
This commit is contained in:
parent
6835e0841c
commit
771d75e722
@ -1,7 +1,7 @@
|
||||
language: cpp
|
||||
#sudo: false
|
||||
install:
|
||||
- sudo apt-get install git dos2unix
|
||||
- sudo apt-get install git dos2unix libosmesa-dev
|
||||
script:
|
||||
- make -C auto clobber
|
||||
- make extensions
|
||||
|
@ -204,8 +204,7 @@ $(S.DEST)/glew.c: $(EXT)/.dummy
|
||||
$(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@
|
||||
$(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@
|
||||
echo -e "\n return GLEW_OK;\n}\n" >> $@
|
||||
echo -e "\n#if defined(GLEW_OSMESA)" >> $@
|
||||
echo -e "\n#elif defined(_WIN32)" >> $@
|
||||
echo -e "\n#if defined(_WIN32) && ! defined(GLEW_OSMESA)" >> $@
|
||||
echo -e "\n#if !defined(GLEW_MX)" >> $@
|
||||
$(BIN)/make_def_fun.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
$(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@
|
||||
|
@ -140,10 +140,10 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
||||
/*
|
||||
* Define glewGetProcAddress.
|
||||
*/
|
||||
#if defined(GLEW_OSMESA)
|
||||
#if defined(GLEW_REGAL)
|
||||
# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *)name)
|
||||
#elif defined(GLEW_OSMESA)
|
||||
# define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name)
|
||||
#elif defined(GLEW_REGAL)
|
||||
# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *) name)
|
||||
#elif defined(_WIN32)
|
||||
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
|
||||
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
||||
|
@ -39,11 +39,11 @@ GLenum GLEWAPIENTRY glewInit (void)
|
||||
GLenum r;
|
||||
r = glewContextInit();
|
||||
if ( r != 0 ) return r;
|
||||
#if defined(GLEW_OSMESA)
|
||||
#if defined(GLEW_OSMESA) || defined(__ANDROID__) || defined(__native_client__) || defined(__HAIKU__)
|
||||
return r;
|
||||
#elif defined(_WIN32)
|
||||
return wglewInit();
|
||||
#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */
|
||||
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
|
||||
return glxewInit();
|
||||
#else
|
||||
return r;
|
||||
|
@ -4,8 +4,7 @@
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
#if defined(_WIN32) && !defined(GLEW_OSMESA)
|
||||
|
||||
#if defined(GLEW_MX)
|
||||
GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name)
|
||||
|
@ -24,11 +24,10 @@ static FILE* f;
|
||||
#ifdef GLEW_MX
|
||||
GLEWContext _glewctx;
|
||||
#define glewGetContext() (&_glewctx)
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
#if defined(_WIN32)
|
||||
WGLEWContext _wglewctx;
|
||||
#define wglewGetContext() (&_wglewctx)
|
||||
#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
||||
#elif !defined(GLEW_OSMESA) && !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
||||
GLXEWContext _glxewctx;
|
||||
#define glxewGetContext() (&_glxewctx)
|
||||
#endif
|
||||
|
@ -2,8 +2,7 @@
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
#if defined(GLEW_OSMESA)
|
||||
#elif defined(_WIN32)
|
||||
#if defined(_WIN32) && !defined(GLEW_OSMESA)
|
||||
|
||||
static void wglewInfo ()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ endif()
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
|
||||
option (BUILD_UTILS "utilities" ON)
|
||||
option (GLEW_OSMESA "OSMesa mode" FALSE)
|
||||
|
||||
set (GLEW_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
||||
|
||||
@ -41,6 +42,20 @@ set (GLEW_LIBRARIES ${OPENGL_LIBRARIES})
|
||||
|
||||
add_definitions (-DGLEW_NO_GLU)
|
||||
|
||||
#### OSMesa ####
|
||||
|
||||
if (GLEW_OSMESA)
|
||||
if (WIN32)
|
||||
set (OSMESA_LIB_NAME osmesa)
|
||||
else ()
|
||||
set (OSMESA_LIB_NAME OSMesa)
|
||||
endif ()
|
||||
add_definitions (-DGLEW_OSMESA)
|
||||
set (GLEW_LIBRARIES ${OSMESA_LIB_NAME} ${OPENGL_LIBRARIES})
|
||||
endif ()
|
||||
|
||||
#### GLEW ####
|
||||
|
||||
include_directories (${GLEW_DIR}/include)
|
||||
|
||||
add_library (glew SHARED ${GLEW_DIR}/src/glew.c)
|
||||
|
Loading…
Reference in New Issue
Block a user