Skip to content

Commit

Permalink
raspberrypi: The latest Raspbian moved its EGL and GLES2 libs elsewhere.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
icculus committed Sep 6, 2017
1 parent fa0eeff commit 0c892ab
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/video/SDL_egl.c
Expand Up @@ -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"

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0c892ab

Please sign in to comment.