diff --git a/Source/Core/DolphinWX/GLInterface/AGL.cpp b/Source/Core/DolphinWX/GLInterface/AGL.cpp index a2dbdb1c6b..1068e870a0 100644 --- a/Source/Core/DolphinWX/GLInterface/AGL.cpp +++ b/Source/Core/DolphinWX/GLInterface/AGL.cpp @@ -21,37 +21,16 @@ #include "ConfigManager.h" #include -#import #include "VertexShaderManager.h" #include "../GLInterface.h" #include "AGL.h" -// Copied from -// https://developer.apple.com/library/mac/documentation/graphicsimaging/conceptual/opengl-macprogguide/opengl_entrypts/opengl_entrypts.html -void* NSGLGetProcAddress (const char *name) -{ - NSSymbol symbol; - char* symbolName; - symbolName = (char*)malloc(strlen (name) + 2); // 1 - strcpy(symbolName + 1, name); // 2 - symbolName[0] = '_'; // 3 - symbol = NULL; - if (NSIsSymbolNameDefined (symbolName)) // 4 - symbol = NSLookupAndBindSymbol (symbolName); - free (symbolName); // 5 - return symbol ? NSAddressOfSymbol (symbol) : NULL; // 6 -} - void cInterfaceAGL::Swap() { [GLWin.cocoaCtx flushBuffer]; } -void* cInterfaceAGL::GetProcAddress(std::string name) -{ - return NSGLGetProcAddress(name.c_str()); -} // Create rendering window. // Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize() bool cInterfaceAGL::Create(void *&window_handle) diff --git a/Source/Core/DolphinWX/GLInterface/AGL.h b/Source/Core/DolphinWX/GLInterface/AGL.h index 8cdf3a1ff0..eca792d4f9 100644 --- a/Source/Core/DolphinWX/GLInterface/AGL.h +++ b/Source/Core/DolphinWX/GLInterface/AGL.h @@ -27,7 +27,6 @@ class cInterfaceAGL : public cInterfaceBase { public: void Swap(); - void* GetProcAddress(std::string name); bool Create(void *&window_handle); bool MakeCurrent(); bool ClearCurrent(); diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp index 5dc766b951..44a278ef63 100644 --- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp +++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp @@ -773,7 +773,6 @@ PFNGLNAMEDBUFFERSTORAGEEXTPROC glNamedBufferStorageEXT; namespace GLExtensions { // Private members and functions - void *_dlsym; bool _isES3; bool _isES; u32 _GLVersion; @@ -846,10 +845,9 @@ namespace GLExtensions *func = GLInterface->GetProcAddress(name); if (*func == NULL) { -#if defined(__linux__) +#if defined(__linux__) || defined(__APPLE__) // Give it a second try with dlsym - if (_dlsym) // Just in case dlopen fails - *func = dlsym(_dlsym, name.c_str()); + *func = dlsym(RTLD_NEXT, name.c_str()); #endif if (*func == NULL && _isES) *func = (void*)0xFFFFFFFF; // Easy to determine invalid function, just so we continue on @@ -869,9 +867,6 @@ namespace GLExtensions bool Init() { bool success = true; -#if defined(__linux__) - _dlsym = dlopen(NULL, RTLD_LAZY); -#endif _isES3 = GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3; _isES = GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3 || GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES2; @@ -913,9 +908,6 @@ namespace GLExtensions if (success && !init_khr_debug()) success = false; if (success && !init_arb_buffer_storage()) success = false; -#if defined(__linux__) - dlclose(_dlsym); -#endif return success; }