Load libOpenGL.so.1 if libGL.so.1 is not found

This commit is contained in:
Cacodemon345 2021-03-14 22:36:20 +06:00 committed by Sam Lantinga
parent b49e0953b1
commit 5f7eb88ae0
1 changed files with 9 additions and 1 deletions

View File

@ -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
}