Fixed 3783 - Default libGL path for directFB on Linux differs from x11 path
authorSam Lantinga <slouken@libsdl.org>
Mon, 28 Aug 2017 09:51:25 -0700
changeset 11391665376404df1
parent 11390 8244c62d8fbc
child 11392 833ec9f10b80
Fixed 3783 - Default libGL path for directFB on Linux differs from x11 path

Clayton Craft

The default path used by directfb for libGL is different than the default path used by x11 in SDL2:

./src/video/directfb/SDL_DirectFB_opengl.c:
path = "libGL.so";

./src/video/x11/SDL_x11opengl.c:
#define DEFAULT_OPENGL "libGL.so.1"

On at least one distro (Alpine Linux), libGL.so is not created (or more accurately the symlink to libGL.so.1 is not created). For consistency, the 'path' variable in SDL_DirectFB_opengl.c should patch the DEFAULT_OPENGL in SDL_x11opengl.c ("libGL.so.1")
src/video/directfb/SDL_DirectFB_opengl.c
     1.1 --- a/src/video/directfb/SDL_DirectFB_opengl.c	Mon Aug 28 09:41:00 2017 -0700
     1.2 +++ b/src/video/directfb/SDL_DirectFB_opengl.c	Mon Aug 28 09:51:25 2017 -0700
     1.3 @@ -117,9 +117,9 @@
     1.4  
     1.5  
     1.6      if (path == NULL) {
     1.7 -        path = SDL_getenv("SDL_VIDEO_GL_DRIVER");
     1.8 +        path = SDL_getenv("SDL_OPENGL_LIBRARY");
     1.9          if (path == NULL) {
    1.10 -            path = "libGL.so";
    1.11 +            path = "libGL.so.1";
    1.12          }
    1.13      }
    1.14