From 0214bab0fe30d45dfaa7d2a1f2a269046418f019 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 15 Nov 2013 15:41:15 -0400 Subject: [PATCH] Reduced initialization time of the graphics module in OS X by ~80ms --- src/modules/graphics/opengl/GLee.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/modules/graphics/opengl/GLee.c b/src/modules/graphics/opengl/GLee.c index 440895784..c2910e46e 100644 --- a/src/modules/graphics/opengl/GLee.c +++ b/src/modules/graphics/opengl/GLee.c @@ -43,8 +43,13 @@ #include "GLee.h" #if defined(__APPLE__) || defined(__APPLE_CC__) +#define GLEE_USE_SDL +#ifdef GLEE_USE_SDL + #include +#else #include #endif +#endif typedef GLuint(*GLEE_LINK_FUNCTION)(void); @@ -64,6 +69,9 @@ GLEE_FUNC __GLeeGetProcAddress(const char *extname) #ifdef _WIN32 return (GLEE_FUNC)wglGetProcAddress(extname); #elif defined(__APPLE__) || defined(__APPLE_CC__) +#if defined(GLEE_USE_SDL) + return SDL_GL_GetProcAddress(extname); +#else CFBundleRef bundle; CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/System/Library/Frameworks/OpenGL.framework"), kCFURLPOSIXPathStyle, true); @@ -87,6 +95,7 @@ GLEE_FUNC __GLeeGetProcAddress(const char *extname) CFRelease(bundle); return function; +#endif #else return (GLEE_FUNC)glXGetProcAddressARB((const GLubyte *)extname); #endif