Skip to content

Commit

Permalink
Try more possible names for OpenGLES library. Fixes SFML#1687
Browse files Browse the repository at this point in the history
  • Loading branch information
spacechase0 committed Jun 29, 2021
1 parent 9e79d61 commit 5b33904
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/SFML/Window/iOS/EaglContext.mm
Expand Up @@ -164,8 +164,19 @@ void ensureInit()
{
static void* module = 0;

if (!module)
module = dlopen("libGLESv1_CM.dylib", RTLD_LAZY | RTLD_LOCAL);
const int LIB_COUNT = 3;
const char* LIBS[LIB_COUNT] =
{
"libGLESv1_CM.dylib",
"/System/Library/Frameworks/OpenGLES.framework/OpenGLES",
"OpenGLES.framework/OpenGLES"
};

for ( int i = 0; i < LIB_COUNT; ++i )
{
if ( !module )
module = dlopen( LIBS[ i ], RTLD_LAZY | RTLD_LOCAL );
}

if (module)
return reinterpret_cast<GlFunctionPointer>(dlsym(module, name));
Expand Down

0 comments on commit 5b33904

Please sign in to comment.