Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_gdirender.c @ 3056:a434fe6360df
Oh, Polyline() uses a pen, not a brush. Doh! :)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 08 Feb 2009 15:35:06 +0000 |
parents | cd863dd2082b |
children | 0d12e8f1de3c |
comparison
equal
deleted
inserted
replaced
3055:cd863dd2082b | 3056:a434fe6360df |
---|---|
671 static int | 671 static int |
672 GDI_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) | 672 GDI_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) |
673 { | 673 { |
674 GDI_RenderData *data = (GDI_RenderData *) renderer->driverdata; | 674 GDI_RenderData *data = (GDI_RenderData *) renderer->driverdata; |
675 POINT points[2]; | 675 POINT points[2]; |
676 HBRUSH brush; | 676 HPEN pen; |
677 BOOL status; | 677 BOOL status; |
678 | 678 |
679 if (data->makedirty) { | 679 if (data->makedirty) { |
680 SDL_Rect rect; | 680 SDL_Rect rect; |
681 | 681 |
694 rect.h = (y1 - y2) + 1; | 694 rect.h = (y1 - y2) + 1; |
695 } | 695 } |
696 SDL_AddDirtyRect(&data->dirty, &rect); | 696 SDL_AddDirtyRect(&data->dirty, &rect); |
697 } | 697 } |
698 | 698 |
699 /* Should we cache the brushes? .. it looks like GDI does for us. :) */ | 699 /* Should we cache the pen? .. it looks like GDI does for us. :) */ |
700 brush = CreateSolidBrush(RGB(renderer->r, renderer->g, renderer->b)); | 700 pen = CreatePen(PS_SOLID, 1, RGB(renderer->r, renderer->g, renderer->b)); |
701 SelectObject(data->current_hdc, brush); | 701 SelectObject(data->current_hdc, pen); |
702 points[0].x = x1; | 702 points[0].x = x1; |
703 points[0].y = y1; | 703 points[0].y = y1; |
704 points[1].x = x2; | 704 points[1].x = x2; |
705 points[1].y = y2; | 705 points[1].y = y2; |
706 status = Polyline(data->current_hdc, points, 2); | 706 status = Polyline(data->current_hdc, points, 2); |
707 DeleteObject(brush); | 707 DeleteObject(pen); |
708 | 708 |
709 if (!status) { | 709 if (!status) { |
710 WIN_SetError("FillRect()"); | 710 WIN_SetError("FillRect()"); |
711 return -1; | 711 return -1; |
712 } | 712 } |