From 0c892abcd0ee298001552e77ca9da5ee948462d8 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 6 Sep 2017 19:34:23 -0400 Subject: [PATCH] raspberrypi: The latest Raspbian moved its EGL and GLES2 libs elsewhere. Now we try the new (hardware-specific) pathnames first, and if those fail to load, we'll try the more generic names that earlier versions of Raspbian used. Fixes Bugzilla #3800. --- src/video/SDL_egl.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 851826c282b0c..a0c592bd83577 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -44,8 +44,10 @@ #if SDL_VIDEO_DRIVER_RPI /* Raspbian places the OpenGL ES/EGL binaries in a non standard path */ -#define DEFAULT_EGL "/opt/vc/lib/libEGL.so" -#define DEFAULT_OGL_ES2 "/opt/vc/lib/libGLESv2.so" +#define DEFAULT_EGL "/opt/vc/lib/libbrcmEGL.so" +#define DEFAULT_OGL_ES2 "/opt/vc/lib/libbrcmGLESv2.so" +#define ALT_EGL "/opt/vc/lib/libEGL.so" +#define ALT_OGL_ES2 "/opt/vc/lib/libGLESv2.so" #define DEFAULT_OGL_ES_PVR "/opt/vc/lib/libGLES_CM.so" #define DEFAULT_OGL_ES "/opt/vc/lib/libGLESv1_CM.so" @@ -292,6 +294,13 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa if (_this->gl_config.major_version > 1) { path = DEFAULT_OGL_ES2; egl_dll_handle = SDL_LoadObject(path); +#ifdef ALT_OGL_ES2 + if (egl_dll_handle == NULL) { + path = ALT_OGL_ES2; + egl_dll_handle = SDL_LoadObject(path); + } +#endif + } else { path = DEFAULT_OGL_ES; egl_dll_handle = SDL_LoadObject(path); @@ -328,6 +337,14 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa path = DEFAULT_EGL; } dll_handle = SDL_LoadObject(path); + +#ifdef ALT_EGL + if (dll_handle == NULL) { + path = ALT_EGL; + dll_handle = SDL_LoadObject(path); + } +#endif + if (dll_handle == NULL || SDL_LoadFunction(dll_handle, "eglChooseConfig") == NULL) { if (dll_handle != NULL) { SDL_UnloadObject(dll_handle);