Oh, Polyline() uses a pen, not a brush. Doh! :)
authorSam Lantinga <slouken@libsdl.org>
Sun, 08 Feb 2009 15:35:06 +0000
changeset 3056a434fe6360df
parent 3055 cd863dd2082b
child 3057 089a77aebb7d
Oh, Polyline() uses a pen, not a brush. Doh! :)
src/video/win32/SDL_gdirender.c
     1.1 --- a/src/video/win32/SDL_gdirender.c	Sat Feb 07 18:03:46 2009 +0000
     1.2 +++ b/src/video/win32/SDL_gdirender.c	Sun Feb 08 15:35:06 2009 +0000
     1.3 @@ -673,7 +673,7 @@
     1.4  {
     1.5      GDI_RenderData *data = (GDI_RenderData *) renderer->driverdata;
     1.6      POINT points[2];
     1.7 -    HBRUSH brush;
     1.8 +    HPEN pen;
     1.9      BOOL status;
    1.10  
    1.11      if (data->makedirty) {
    1.12 @@ -696,15 +696,15 @@
    1.13          SDL_AddDirtyRect(&data->dirty, &rect);
    1.14      }
    1.15  
    1.16 -    /* Should we cache the brushes? .. it looks like GDI does for us. :) */
    1.17 -    brush = CreateSolidBrush(RGB(renderer->r, renderer->g, renderer->b));
    1.18 -    SelectObject(data->current_hdc, brush);
    1.19 +    /* Should we cache the pen? .. it looks like GDI does for us. :) */
    1.20 +    pen = CreatePen(PS_SOLID, 1, RGB(renderer->r, renderer->g, renderer->b));
    1.21 +    SelectObject(data->current_hdc, pen);
    1.22      points[0].x = x1;
    1.23      points[0].y = y1;
    1.24      points[1].x = x2;
    1.25      points[1].y = y2;
    1.26      status = Polyline(data->current_hdc, points, 2);
    1.27 -    DeleteObject(brush);
    1.28 +    DeleteObject(pen);
    1.29  
    1.30      if (!status) {
    1.31          WIN_SetError("FillRect()");