diff src/video/x11/SDL_x11window.c @ 2945:e38423786728

Fixed DirectColor visual window creation problem
author Sam Lantinga <slouken@libsdl.org>
date Thu, 01 Jan 2009 18:58:26 +0000
parents 1e431c2631ee
children e4a469d6ddab
line wrap: on
line diff
--- a/src/video/x11/SDL_x11window.c	Thu Jan 01 18:49:43 2009 +0000
+++ b/src/video/x11/SDL_x11window.c	Thu Jan 01 18:58:26 2009 +0000
@@ -212,7 +212,7 @@
     xattr.background_pixel = 0;
     xattr.border_pixel = 0;
 
-    if (visual->class == DirectColor || visual->class == PseudoColor) {
+    if (visual->class == PseudoColor) {
         int nmaps;
         XStandardColormap cmap;
         XStandardColormap *stdmaps;
@@ -299,6 +299,12 @@
             X11_TrackColormap(data->display, displaydata->screen, colormap,
                               &cmap, visual);
         }
+    } else if (visual->class == DirectColor) {
+        /* FIXME: Allocate a read-write colormap for gamma fading someday */
+        xattr.colormap =
+            XCreateColormap(data->display,
+                            RootWindow(data->display, displaydata->screen),
+                            visual, AllocNone);
     } else {
         xattr.colormap =
             XCreateColormap(data->display,