Try more possible names for OpenGLES library. Fixes SFML/SFML#1687

This commit is contained in:
Chase Warrington 2021-06-28 21:27:10 -04:00 committed by Lukas Dürrenberger
parent 089f0fd8b4
commit 47a4e88704

View File

@ -164,8 +164,19 @@ GlFunctionPointer EaglContext::getFunction(const char* name)
{ {
static void* module = 0; static void* module = 0;
if (!module) const int libCount = 3;
module = dlopen("libGLESv1_CM.dylib", RTLD_LAZY | RTLD_LOCAL); const char* libs[libCount] =
{
"libGLESv1_CM.dylib",
"/System/Library/Frameworks/OpenGLES.framework/OpenGLES",
"OpenGLES.framework/OpenGLES"
};
for (int i = 0; i < libCount; ++i)
{
if (!module)
module = dlopen(libs[i], RTLD_LAZY | RTLD_LOCAL);
}
if (module) if (module)
return reinterpret_cast<GlFunctionPointer>(dlsym(module, name)); return reinterpret_cast<GlFunctionPointer>(dlsym(module, name));