src/video/SDL_egl.c
changeset 11851 8f295e7acefd
parent 11839 971881e55d61
child 11872 e917e911dab6
equal deleted inserted replaced
11850:8d97fd557ba1 11851:8f295e7acefd
    42 #endif
    42 #endif
    43 #endif /* EGL_KHR_create_context */
    43 #endif /* EGL_KHR_create_context */
    44 
    44 
    45 #if SDL_VIDEO_DRIVER_RPI
    45 #if SDL_VIDEO_DRIVER_RPI
    46 /* Raspbian places the OpenGL ES/EGL binaries in a non standard path */
    46 /* Raspbian places the OpenGL ES/EGL binaries in a non standard path */
    47 static const char g_rpi_opt_path[] = "/opt/vc/lib";
       
    48 #define DEFAULT_EGL ( vc4 ? "libEGL.so.1" : "libbrcmEGL.so" )
    47 #define DEFAULT_EGL ( vc4 ? "libEGL.so.1" : "libbrcmEGL.so" )
    49 #define DEFAULT_OGL_ES2 ( vc4 ? "libGLESv2.so.2" : "libbrcmGLESv2.so" )
    48 #define DEFAULT_OGL_ES2 ( vc4 ? "libGLESv2.so.2" : "libbrcmGLESv2.so" )
    50 #define ALT_EGL "libEGL.so"
    49 #define ALT_EGL "libEGL.so"
    51 #define ALT_OGL_ES2 "libGLESv2.so"
    50 #define ALT_OGL_ES2 "libGLESv2.so"
    52 #define DEFAULT_OGL_ES_PVR ( vc4 ? "libGLES_CM.so.1" : "libbrcmGLESv2.so" )
    51 #define DEFAULT_OGL_ES_PVR ( vc4 ? "libGLES_CM.so.1" : "libbrcmGLESv2.so" )
   264 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
   263 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
   265     const char *d3dcompiler;
   264     const char *d3dcompiler;
   266 #endif
   265 #endif
   267 #if SDL_VIDEO_DRIVER_RPI
   266 #if SDL_VIDEO_DRIVER_RPI
   268     SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK));
   267     SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK));
   269 
       
   270     path = SDL_getenv("LD_LIBRARY_PATH");
       
   271     if (path) {
       
   272         const int path_size = SDL_strlen(path) + 1 + sizeof(g_rpi_opt_path);
       
   273         char *new_path = SDL_calloc(1, path_size);
       
   274         strcat(new_path, path);
       
   275         strcat(new_path, ":");
       
   276         strcat(new_path, g_rpi_opt_path);
       
   277         SDL_setenv("LD_LIBRARY_PATH", new_path, 1);
       
   278         SDL_free(new_path);
       
   279     } else {
       
   280         SDL_setenv("LD_LIBRARY_PATH", g_rpi_opt_path, 1);
       
   281     }
       
   282     path = NULL;
       
   283 #endif
   268 #endif
   284 
   269 
   285     if (_this->egl_data) {
   270     if (_this->egl_data) {
   286         return SDL_SetError("EGL context already created");
   271         return SDL_SetError("EGL context already created");
   287     }
   272     }