Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Xrender uses 16 bit color per channel. Fixed the color handling in X1…
Browse files Browse the repository at this point in the history
…1_RenderFillRects to match this. Xrender just works now for filling rectangles :D .
  • Loading branch information
sunnyps committed May 31, 2010
1 parent 941436d commit bb399ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/video/x11/SDL_x11render.c
Expand Up @@ -1001,10 +1001,10 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
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);
}
Expand Down

0 comments on commit bb399ee

Please sign in to comment.