# HG changeset patch # User Sam Lantinga # Date 1230911269 0 # Node ID ee331407574fa3280c41a9af40e46597f5c6400a # Parent 1e242954330bb79698433d24fb2e0d935afadea2 Don't use DirectColor visuals until we implement DirectColor colormap support diff -r 1e242954330b -r ee331407574f src/video/x11/SDL_x11modes.c --- a/src/video/x11/SDL_x11modes.c Fri Jan 02 10:30:53 2009 +0000 +++ b/src/video/x11/SDL_x11modes.c Fri Jan 02 15:47:49 2009 +0000 @@ -32,9 +32,6 @@ get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) { const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID"); - /* We really don't need DirectColor visuals until we implement - * gamma ramps, but we'll leave it on for now to catch bugs */ - int use_directcolor = 0; int depth; /* Look for an exact visual, if requested */ @@ -53,7 +50,7 @@ } depth = DefaultDepth(display, screen); - if ((use_directcolor && + if ((X11_UseDirectColorVisuals() && XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) || XMatchVisualInfo(display, screen, depth, TrueColor, vinfo) || XMatchVisualInfo(display, screen, depth, PseudoColor, vinfo) || diff -r 1e242954330b -r ee331407574f src/video/x11/SDL_x11opengl.c --- a/src/video/x11/SDL_x11opengl.c Fri Jan 02 10:30:53 2009 +0000 +++ b/src/video/x11/SDL_x11opengl.c Fri Jan 02 15:47:49 2009 +0000 @@ -391,7 +391,7 @@ attribs[i++] = GLX_NONE_EXT; } #ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */ - if (!SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR")) { + if (X11_UseDirectColorVisuals()) { attribs[i++] = GLX_X_VISUAL_TYPE; attribs[i++] = GLX_DIRECT_COLOR; } @@ -400,7 +400,7 @@ vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs); #ifdef GLX_DIRECT_COLOR - if (!vinfo && !SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR")) { /* No DirectColor visual? Try again.. */ + if (!vinfo && X11_UseDirectColorVisuals()) { /* No DirectColor visual? Try again.. */ attribs[i - 3] = None; vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs); } diff -r 1e242954330b -r ee331407574f src/video/x11/SDL_x11video.c --- a/src/video/x11/SDL_x11video.c Fri Jan 02 10:30:53 2009 +0000 +++ b/src/video/x11/SDL_x11video.c Fri Jan 02 15:47:49 2009 +0000 @@ -267,4 +267,13 @@ X11_QuitMouse(_this); } +SDL_bool +X11_UseDirectColorVisuals() +{ + /* Once we implement DirectColor colormaps and gamma ramp support... + return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE; + */ + return SDL_FALSE; +} + /* vim: set ts=4 sw=4 expandtab: */ diff -r 1e242954330b -r ee331407574f src/video/x11/SDL_x11video.h --- a/src/video/x11/SDL_x11video.h Fri Jan 02 10:30:53 2009 +0000 +++ b/src/video/x11/SDL_x11video.h Fri Jan 02 15:47:49 2009 +0000 @@ -76,6 +76,8 @@ SDL_scancode key_layout[256]; } SDL_VideoData; +extern SDL_bool X11_UseDirectColorVisuals(); + #endif /* _SDL_x11video_h */ /* vi: set ts=4 sw=4 expandtab: */