comparison src/video/x11/SDL_x11modes.c @ 2963:ee331407574f

Don't use DirectColor visuals until we implement DirectColor colormap support
author Sam Lantinga <slouken@libsdl.org>
date Fri, 02 Jan 2009 15:47:49 +0000
parents 2c01dc6218cc
children 4b594623401b
comparison
equal deleted inserted replaced
2962:1e242954330b 2963:ee331407574f
30 30
31 static int 31 static int
32 get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) 32 get_visualinfo(Display * display, int screen, XVisualInfo * vinfo)
33 { 33 {
34 const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID"); 34 const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID");
35 /* We really don't need DirectColor visuals until we implement
36 * gamma ramps, but we'll leave it on for now to catch bugs */
37 int use_directcolor = 0;
38 int depth; 35 int depth;
39 36
40 /* Look for an exact visual, if requested */ 37 /* Look for an exact visual, if requested */
41 if (visual_id) { 38 if (visual_id) {
42 XVisualInfo *vi, template; 39 XVisualInfo *vi, template;
51 return 0; 48 return 0;
52 } 49 }
53 } 50 }
54 51
55 depth = DefaultDepth(display, screen); 52 depth = DefaultDepth(display, screen);
56 if ((use_directcolor && 53 if ((X11_UseDirectColorVisuals() &&
57 XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) || 54 XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) ||
58 XMatchVisualInfo(display, screen, depth, TrueColor, vinfo) || 55 XMatchVisualInfo(display, screen, depth, TrueColor, vinfo) ||
59 XMatchVisualInfo(display, screen, depth, PseudoColor, vinfo) || 56 XMatchVisualInfo(display, screen, depth, PseudoColor, vinfo) ||
60 XMatchVisualInfo(display, screen, depth, StaticColor, vinfo)) { 57 XMatchVisualInfo(display, screen, depth, StaticColor, vinfo)) {
61 return 0; 58 return 0;