Commit 1e90d10f authored by Nigel Stewart's avatar Nigel Stewart
Browse files

Use glGetProcAddressREGAL for GLEW_REGAL purposes.

parent c65f7dd8
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment