From 47a4e8870464ecbbe4f7a767258e883994c41509 Mon Sep 17 00:00:00 2001 From: Chase Warrington Date: Mon, 28 Jun 2021 21:27:10 -0400 Subject: [PATCH] Try more possible names for OpenGLES library. Fixes SFML/SFML#1687 --- src/SFML/Window/iOS/EaglContext.mm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/SFML/Window/iOS/EaglContext.mm b/src/SFML/Window/iOS/EaglContext.mm index f8d55d99..93fef51c 100644 --- a/src/SFML/Window/iOS/EaglContext.mm +++ b/src/SFML/Window/iOS/EaglContext.mm @@ -164,8 +164,19 @@ GlFunctionPointer EaglContext::getFunction(const char* name) { static void* module = 0; - if (!module) - module = dlopen("libGLESv1_CM.dylib", RTLD_LAZY | RTLD_LOCAL); + const int libCount = 3; + 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) return reinterpret_cast(dlsym(module, name));