mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-29 09:11:56 +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
|
# define GLXEW_CONTEXT_ARG_DEF_LIST void
|
||||||
#endif /* GLEW_MX */
|
#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 <dlfcn.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -73,11 +74,7 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
|||||||
void* addr;
|
void* addr;
|
||||||
if (NULL == image)
|
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);
|
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if( !image ) return NULL;
|
if( !image ) return NULL;
|
||||||
addr = dlsym(image, (const char*)name);
|
addr = dlsym(image, (const char*)name);
|
||||||
@ -99,11 +96,7 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
|||||||
char* symbolName;
|
char* symbolName;
|
||||||
if (NULL == image)
|
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);
|
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 */
|
/* prepend a '_' for the Unix C symbol mangling convention */
|
||||||
symbolName = malloc(strlen((const char*)name) + 2);
|
symbolName = malloc(strlen((const char*)name) + 2);
|
||||||
@ -127,7 +120,9 @@ void* NSGLGetProcAddress (const GLubyte *name)
|
|||||||
/*
|
/*
|
||||||
* Define glewGetProcAddress.
|
* Define glewGetProcAddress.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN32)
|
#if defined(GLEW_REGAL)
|
||||||
|
# define glewGetProcAddress(name) glGetProcAddressREGAL(name)
|
||||||
|
#elif defined(_WIN32)
|
||||||
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
|
# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
|
||||||
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
||||||
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
|
# define glewGetProcAddress(name) NSGLGetProcAddress(name)
|
||||||
|
Loading…
Reference in New Issue
Block a user