Skip to content

Commit

Permalink
Support SDL_VIDEO_X11_NODIRECTCOLOR for OpenGL visuals
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed May 16, 2005
1 parent a2996df commit 5a4b449
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/video/x11/SDL_x11gl.c
Expand Up @@ -145,15 +145,17 @@ XVisualInfo *X11_GL_GetVisual(_THIS)
}

#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);
Expand Down

0 comments on commit 5a4b449

Please sign in to comment.