Oh, Polyline() uses a pen, not a brush. Doh! :)
authorSam Lantinga <slouken@libsdl.org>
Sun, 08 Feb 2009 15:35:06 +0000
changeset 3056 a434fe6360df
parent 3055 cd863dd2082b
child 3057 089a77aebb7d
Oh, Polyline() uses a pen, not a brush. Doh! :)
src/video/win32/SDL_gdirender.c
--- a/src/video/win32/SDL_gdirender.c	Sat Feb 07 18:03:46 2009 +0000
+++ b/src/video/win32/SDL_gdirender.c	Sun Feb 08 15:35:06 2009 +0000
@@ -673,7 +673,7 @@
 {
     GDI_RenderData *data = (GDI_RenderData *) renderer->driverdata;
     POINT points[2];
-    HBRUSH brush;
+    HPEN pen;
     BOOL status;
 
     if (data->makedirty) {
@@ -696,15 +696,15 @@
         SDL_AddDirtyRect(&data->dirty, &rect);
     }
 
-    /* Should we cache the brushes? .. it looks like GDI does for us. :) */
-    brush = CreateSolidBrush(RGB(renderer->r, renderer->g, renderer->b));
-    SelectObject(data->current_hdc, brush);
+    /* Should we cache the pen? .. it looks like GDI does for us. :) */
+    pen = CreatePen(PS_SOLID, 1, RGB(renderer->r, renderer->g, renderer->b));
+    SelectObject(data->current_hdc, pen);
     points[0].x = x1;
     points[0].y = y1;
     points[1].x = x2;
     points[1].y = y2;
     status = Polyline(data->current_hdc, points, 2);
-    DeleteObject(brush);
+    DeleteObject(pen);
 
     if (!status) {
         WIN_SetError("FillRect()");