Fixes X11 video backend compilation when no GL is available
authorGabriel Jacobo <gabomdq@gmail.com>
Sat, 12 Oct 2013 16:29:34 -0300
changeset 7808627f256b0e56
parent 7807 73da2747c268
child 7809 fd53b2b2a205
Fixes X11 video backend compilation when no GL is available

For example, in our Raspberry Pi sysroot.
README-raspberrypi.txt
src/video/x11/SDL_x11window.c
     1.1 --- a/README-raspberrypi.txt	Sat Oct 12 11:21:40 2013 -0400
     1.2 +++ b/README-raspberrypi.txt	Sat Oct 12 16:29:34 2013 -0300
     1.3 @@ -69,7 +69,13 @@
     1.4      cd <SDL SOURCE>
     1.5      mkdir -p build;cd build
     1.6      ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
     1.7 +    make
     1.8 +    make install
     1.9  
    1.10 +To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
    1.11 +    
    1.12 +    perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
    1.13 +    
    1.14  ================================================================================
    1.15   Apps don't work or poor video/audio performance
    1.16  ================================================================================
     2.1 --- a/src/video/x11/SDL_x11window.c	Sat Oct 12 11:21:40 2013 -0400
     2.2 +++ b/src/video/x11/SDL_x11window.c	Sat Oct 12 16:29:34 2013 -0300
     2.3 @@ -370,8 +370,11 @@
     2.4          XVisualInfo *vinfo = NULL;
     2.5  
     2.6  #if SDL_VIDEO_OPENGL_EGL
     2.7 -        if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES && 
     2.8 -            ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )) {
     2.9 +        if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES 
    2.10 +#if SDL_VIDEO_OPENGL_GLX            
    2.11 +            && ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )
    2.12 +#endif
    2.13 +        ){
    2.14              vinfo = X11_GLES_GetVisual(_this, display, screen);
    2.15          } else
    2.16  #endif
    2.17 @@ -555,8 +558,11 @@
    2.18  
    2.19  #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
    2.20      if ((window->flags & SDL_WINDOW_OPENGL) && 
    2.21 -        _this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES && 
    2.22 -        (!_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile) ) {
    2.23 +        _this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES
    2.24 +#if SDL_VIDEO_OPENGL_GLX            
    2.25 +        && ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )
    2.26 +#endif  
    2.27 +    ) {
    2.28          if (!_this->egl_data) {
    2.29              XDestroyWindow(display, w);
    2.30              return -1;