comparison 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
comparison
equal deleted inserted replaced
4577:87a2d87786d4 4578:cb338fa6535c
999 if (xcount > 0) { 999 if (xcount > 0) {
1000 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER 1000 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
1001 if(data->xrender_available == SDL_TRUE) 1001 if(data->xrender_available == SDL_TRUE)
1002 { 1002 {
1003 XRenderColor xrender_foreground_color; 1003 XRenderColor xrender_foreground_color;
1004 xrender_foreground_color.red = renderer->r; 1004 xrender_foreground_color.red = (unsigned short) ((renderer->r / 255.0) * 0xFFFF);
1005 xrender_foreground_color.green = renderer->g; 1005 xrender_foreground_color.green = (unsigned short) ((renderer->g / 255.0) * 0xFFFF);
1006 xrender_foreground_color.blue = renderer->b; 1006 xrender_foreground_color.blue = (unsigned short) ((renderer->b / 255.0) * 0xFFFF);
1007 xrender_foreground_color.alpha = renderer->a; 1007 xrender_foreground_color.alpha = (unsigned short) ((renderer->a / 255.0) * 0xFFFF);
1008 XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict, 1008 XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict,
1009 &xrender_foreground_color, xrects, xcount); 1009 &xrender_foreground_color, xrects, xcount);
1010 } 1010 }
1011 else 1011 else
1012 #endif 1012 #endif