mirror of
https://github.com/Perlmint/glew-cmake.git
synced 2024-11-11 09:33:49 +00:00
Use glGetProcAddressREGAL for GLEW_REGAL purposes.
This commit is contained in:
parent
c65f7dd8d3
commit
1e90d10f17
@ -35,7 +35,8 @@
|
||||
# define GLXEW_CONTEXT_ARG_DEF_LIST void
|
||||
#endif /* GLEW_MX */
|
||||
|
||||
#if defined(__sgi) || defined (__sun) || defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
||||
#if defined(GLEW_REGAL)
|
||||
#elif defined(__sgi) || defined (__sun) || defined(__HAIKU__) || defined(GLEW_APPLE_GLX)
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -73,11 +74,7 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
||||
void* addr;
|
||||
if (NULL == image)
|
||||
{
|
||||
#ifdef GLEW_REGAL
|
||||
image = dlopen("libRegal.dylib", RTLD_LAZY);
|
||||
#else
|
||||
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
|
||||
#endif
|
||||
}
|
||||
if( !image ) return NULL;
|
||||
addr = dlsym(image, (const char*)name);
|
||||
@ -99,11 +96,7 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
||||
char* symbolName;
|
||||
if (NULL == image)
|
||||
{
|
||||
#ifdef GLEW_REGAL
|
||||
image = NSAddImage("libRegal.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
|
||||
#else
|
||||
image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
|
||||
#endif
|
||||
}
|
||||
/* prepend a '_' for the Unix C symbol mangling convention */
|
||||
symbolName = malloc(strlen((const char*)name) + 2);
|
||||
@ -127,7 +120,9 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
||||
/*
|
||||
* Define glewGetProcAddress.
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
#if defined(GLEW_REGAL)
|
||||
# define glewGetProcAddress(name) glGetProcAddressREGAL(name)
|
||||
#elif defined(_WIN32)
|
||||
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
|
||||
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
||||
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
|
||||
|
Loading…
Reference in New Issue
Block a user