diff src/video/x11/SDL_x11render.c @ 4578:cb338fa6535c

Xrender uses 16 bit color per channel. Fixed the color handling in X11_RenderFillRects to match this. Xrender just works now for filling rectangles :D .
author Sunny Sachanandani <sunnysachanandani@gmail.com>
date Mon, 31 May 2010 15:09:36 +0530
parents 87a2d87786d4
children d490d63bcc5e
line wrap: on
line diff
--- a/src/video/x11/SDL_x11render.c	Mon May 31 13:27:27 2010 +0530
+++ b/src/video/x11/SDL_x11render.c	Mon May 31 15:09:36 2010 +0530
@@ -1001,10 +1001,10 @@
         if(data->xrender_available == SDL_TRUE)
         {
             XRenderColor xrender_foreground_color;
-            xrender_foreground_color.red = renderer->r;
-            xrender_foreground_color.green = renderer->g;
-            xrender_foreground_color.blue = renderer->b;
-            xrender_foreground_color.alpha = renderer->a;
+            xrender_foreground_color.red = (unsigned short) ((renderer->r / 255.0) * 0xFFFF);
+            xrender_foreground_color.green = (unsigned short) ((renderer->g / 255.0) * 0xFFFF);
+            xrender_foreground_color.blue = (unsigned short) ((renderer->b / 255.0) * 0xFFFF);
+            xrender_foreground_color.alpha = (unsigned short) ((renderer->a / 255.0) * 0xFFFF);
             XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict,
                                   &xrender_foreground_color, xrects, xcount);
         }