[SDL] X11+GL: Allow Visual override for GL windows.
authorpgriffais@spaceport
Tue, 10 Sep 2013 18:25:13 -0700
changeset 7737 e9d463cb5b49
parent 7736 84d89d60908f
child 7738 10981a646a6d
[SDL] X11+GL: Allow Visual override for GL windows. SDL provides an SDL_VIDEO_X11_VISUALID environment variable that lets you override window visuals, but it wasn't being checked for OpenGL windows. CR: Sam.
src/video/x11/SDL_x11window.c
--- a/src/video/x11/SDL_x11window.c	Sat Sep 07 13:57:20 2013 -0400
+++ b/src/video/x11/SDL_x11window.c	Tue Sep 10 18:25:13 2013 -0700
@@ -365,7 +365,8 @@
     Uint32 fevent = 0;
 
 #if SDL_VIDEO_OPENGL_GLX || SDL_VIDEO_OPENGL_EGL
-    if (window->flags & SDL_WINDOW_OPENGL) {
+    if ((window->flags & SDL_WINDOW_OPENGL) &&
+        !SDL_getenv("SDL_VIDEO_X11_VISUALID")) {
         XVisualInfo *vinfo = NULL;
 
 #if SDL_VIDEO_OPENGL_EGL