src/video/SDL_egl.c
changeset 11829 fcbafc9e443c
parent 11811 5d94cb6b24d3
child 11830 a01af1a724b3
equal deleted inserted replaced
11828:da1ca77eb713 11829:fcbafc9e443c
    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 #define DEFAULT_EGL ( vc4 ? "libEGL.so.1" : "/opt/vc/lib/libbrcmEGL.so" )
    47 static const char g_rpi_opt_path[] = "/opt/vc/lib";
    48 #define DEFAULT_OGL_ES2 ( vc4 ? "libGLESv2.so.2" : "/opt/vc/lib/libbrcmGLESv2.so" )
    48 #define DEFAULT_EGL ( vc4 ? "libEGL.so.1" : "libbrcmEGL.so" )
    49 #define ALT_EGL "/opt/vc/lib/libEGL.so"
    49 #define DEFAULT_OGL_ES2 ( vc4 ? "libGLESv2.so.2" : "libbrcmGLESv2.so" )
    50 #define ALT_OGL_ES2 "/opt/vc/lib/libGLESv2.so"
    50 #define ALT_EGL "libEGL.so"
    51 #define DEFAULT_OGL_ES_PVR ( vc4 ? "libGLES_CM.so.1" : "/opt/vc/lib/libbrcmGLESv2.so" )
    51 #define ALT_OGL_ES2 "libGLESv2.so"
    52 #define DEFAULT_OGL_ES ( vc4 ? "libGLESv1_CM.so.1" : "/opt/vc/lib/libbrcmGLESv2.so" )
    52 #define DEFAULT_OGL_ES_PVR ( vc4 ? "libGLES_CM.so.1" : "libbrcmGLESv2.so" )
       
    53 #define DEFAULT_OGL_ES ( vc4 ? "libGLESv1_CM.so.1" : "libbrcmGLESv2.so" )
    53 
    54 
    54 #elif SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_VIVANTE
    55 #elif SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_VIVANTE
    55 /* Android */
    56 /* Android */
    56 #define DEFAULT_EGL "libEGL.so"
    57 #define DEFAULT_EGL "libEGL.so"
    57 #define DEFAULT_OGL_ES2 "libGLESv2.so"
    58 #define DEFAULT_OGL_ES2 "libGLESv2.so"
   263 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
   264 #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
   264     const char *d3dcompiler;
   265     const char *d3dcompiler;
   265 #endif
   266 #endif
   266 #if SDL_VIDEO_DRIVER_RPI
   267 #if SDL_VIDEO_DRIVER_RPI
   267     SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK));
   268     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;
   268 #endif
   283 #endif
   269 
   284 
   270     if (_this->egl_data) {
   285     if (_this->egl_data) {
   271         return SDL_SetError("EGL context already created");
   286         return SDL_SetError("EGL context already created");
   272     }
   287     }