changeset 1060:86885b40a53b

Support SDL_VIDEO_X11_NODIRECTCOLOR for OpenGL visuals
author Sam Lantinga <slouken@libsdl.org>
date Mon, 16 May 2005 08:23:34 +0000
parents de22ea8440d2
children 5023cde12cbd
files src/video/x11/SDL_x11gl.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/x11/SDL_x11gl.c	Mon May 16 07:43:46 2005 +0000
+++ b/src/video/x11/SDL_x11gl.c	Mon May 16 08:23:34 2005 +0000
@@ -145,15 +145,17 @@
 	}
 
 #ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */
-	attribs[i++] = GLX_X_VISUAL_TYPE;
-	attribs[i++] = GLX_DIRECT_COLOR;
+	if ( !getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) {
+		attribs[i++] = GLX_X_VISUAL_TYPE;
+		attribs[i++] = GLX_DIRECT_COLOR;
+	}
 #endif
 	attribs[i++] = None;
 
  	glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display, 
 						  SDL_Screen, attribs);
 #ifdef GLX_DIRECT_COLOR
-	if( !glx_visualinfo ) { /* No DirectColor visual?  Try again.. */
+	if( !glx_visualinfo && !getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) { /* No DirectColor visual?  Try again.. */
 		attribs[i-3] = None;
  		glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display, 
 						  SDL_Screen, attribs);