mirror of
https://github.com/love2d/love.git
synced 2026-08-19 04:06:17 +02:00
Reduced initialization time of the graphics module in OS X by ~80ms
This commit is contained in:
@@ -43,8 +43,13 @@
|
|||||||
#include "GLee.h"
|
#include "GLee.h"
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__APPLE_CC__)
|
#if defined(__APPLE__) || defined(__APPLE_CC__)
|
||||||
|
#define GLEE_USE_SDL
|
||||||
|
#ifdef GLEE_USE_SDL
|
||||||
|
#include <SDL2/SDL_video.h>
|
||||||
|
#else
|
||||||
#include <CoreFoundation/CFBundle.h>
|
#include <CoreFoundation/CFBundle.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef GLuint(*GLEE_LINK_FUNCTION)(void);
|
typedef GLuint(*GLEE_LINK_FUNCTION)(void);
|
||||||
|
|
||||||
@@ -64,6 +69,9 @@ GLEE_FUNC __GLeeGetProcAddress(const char *extname)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return (GLEE_FUNC)wglGetProcAddress(extname);
|
return (GLEE_FUNC)wglGetProcAddress(extname);
|
||||||
#elif defined(__APPLE__) || defined(__APPLE_CC__)
|
#elif defined(__APPLE__) || defined(__APPLE_CC__)
|
||||||
|
#if defined(GLEE_USE_SDL)
|
||||||
|
return SDL_GL_GetProcAddress(extname);
|
||||||
|
#else
|
||||||
CFBundleRef bundle;
|
CFBundleRef bundle;
|
||||||
CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/System/Library/Frameworks/OpenGL.framework"), kCFURLPOSIXPathStyle, true);
|
CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/System/Library/Frameworks/OpenGL.framework"), kCFURLPOSIXPathStyle, true);
|
||||||
|
|
||||||
@@ -87,6 +95,7 @@ GLEE_FUNC __GLeeGetProcAddress(const char *extname)
|
|||||||
CFRelease(bundle);
|
CFRelease(bundle);
|
||||||
|
|
||||||
return function;
|
return function;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
return (GLEE_FUNC)glXGetProcAddressARB((const GLubyte *)extname);
|
return (GLEE_FUNC)glXGetProcAddressARB((const GLubyte *)extname);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user