Support SDL_VIDEO_X11_NODIRECTCOLOR for OpenGL visuals
authorSam Lantinga <slouken@libsdl.org>
Mon, 16 May 2005 08:23:34 +0000
changeset 106086885b40a53b
parent 1059 de22ea8440d2
child 1061 5023cde12cbd
Support SDL_VIDEO_X11_NODIRECTCOLOR for OpenGL visuals
src/video/x11/SDL_x11gl.c
     1.1 --- a/src/video/x11/SDL_x11gl.c	Mon May 16 07:43:46 2005 +0000
     1.2 +++ b/src/video/x11/SDL_x11gl.c	Mon May 16 08:23:34 2005 +0000
     1.3 @@ -145,15 +145,17 @@
     1.4  	}
     1.5  
     1.6  #ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */
     1.7 -	attribs[i++] = GLX_X_VISUAL_TYPE;
     1.8 -	attribs[i++] = GLX_DIRECT_COLOR;
     1.9 +	if ( !getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) {
    1.10 +		attribs[i++] = GLX_X_VISUAL_TYPE;
    1.11 +		attribs[i++] = GLX_DIRECT_COLOR;
    1.12 +	}
    1.13  #endif
    1.14  	attribs[i++] = None;
    1.15  
    1.16   	glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display, 
    1.17  						  SDL_Screen, attribs);
    1.18  #ifdef GLX_DIRECT_COLOR
    1.19 -	if( !glx_visualinfo ) { /* No DirectColor visual?  Try again.. */
    1.20 +	if( !glx_visualinfo && !getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) { /* No DirectColor visual?  Try again.. */
    1.21  		attribs[i-3] = None;
    1.22   		glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display, 
    1.23  						  SDL_Screen, attribs);