Fixes X11 video backend compilation when no GL is available
authorGabriel Jacobo <gabomdq@gmail.com>
Sat, 12 Oct 2013 16:29:34 -0300
changeset 7808 627f256b0e56
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
--- a/README-raspberrypi.txt	Sat Oct 12 11:21:40 2013 -0400
+++ b/README-raspberrypi.txt	Sat Oct 12 16:29:34 2013 -0300
@@ -69,7 +69,13 @@
     cd <SDL SOURCE>
     mkdir -p build;cd build
     ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
+    make
+    make install
 
+To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
+    
+    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
+    
 ================================================================================
  Apps don't work or poor video/audio performance
 ================================================================================
--- a/src/video/x11/SDL_x11window.c	Sat Oct 12 11:21:40 2013 -0400
+++ b/src/video/x11/SDL_x11window.c	Sat Oct 12 16:29:34 2013 -0300
@@ -370,8 +370,11 @@
         XVisualInfo *vinfo = NULL;
 
 #if SDL_VIDEO_OPENGL_EGL
-        if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES && 
-            ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )) {
+        if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES 
+#if SDL_VIDEO_OPENGL_GLX            
+            && ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )
+#endif
+        ){
             vinfo = X11_GLES_GetVisual(_this, display, screen);
         } else
 #endif
@@ -555,8 +558,11 @@
 
 #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
     if ((window->flags & SDL_WINDOW_OPENGL) && 
-        _this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES && 
-        (!_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile) ) {
+        _this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES
+#if SDL_VIDEO_OPENGL_GLX            
+        && ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )
+#endif  
+    ) {
         if (!_this->egl_data) {
             XDestroyWindow(display, w);
             return -1;