From 5f7eb88ae0990f89ec3a4bf697ec03aafee1a9a8 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sun, 14 Mar 2021 22:36:20 +0600 Subject: [PATCH] Load libOpenGL.so.1 if libGL.so.1 is not found --- src/video/SDL_egl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 099547b01..fa2c841dc 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -73,6 +73,7 @@ #define DEFAULT_OGL_ES "libGLESv1_CM.dylib" //??? #elif defined(__OpenBSD__) +/* OpenBSD */ #define DEFAULT_OGL "libGL.so" #define DEFAULT_EGL "libEGL.so" #define DEFAULT_OGL_ES2 "libGLESv2.so" @@ -80,9 +81,10 @@ #define DEFAULT_OGL_ES "libGLESv1_CM.so" #else -/* Desktop Linux */ +/* Desktop Linux/Unix-like */ #define DEFAULT_OGL "libGL.so.1" #define DEFAULT_EGL "libEGL.so.1" +#define ALT_OGL "libOpenGL.so.1" #define DEFAULT_OGL_ES2 "libGLESv2.so.2" #define DEFAULT_OGL_ES_PVR "libGLES_CM.so.1" #define DEFAULT_OGL_ES "libGLESv1_CM.so.1" @@ -374,6 +376,12 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) else { path = DEFAULT_OGL; egl_dll_handle = SDL_LoadObject(path); +#ifdef ALT_OGL + if (egl_dll_handle == NULL) { + path = ALT_OGL; + egl_dll_handle = SDL_LoadObject(path); + } +#endif } #endif }