Merge pull request #6 from Lowest0ne/fill-rect

call SDL_RenderFillRect
This commit is contained in:
Dmitry Marakasov 2013-11-15 06:45:35 -08:00
commit c1fb7405c3

View File

@ -160,7 +160,7 @@ void Renderer::DrawRects(const Rect* rects, int count) {
void Renderer::FillRect(int x1, int y1, int x2, int y2) {
SDL_Rect rect = {x1, y1, x2 - x1 + 1, y2 - y1 + 1};
if (SDL_RenderDrawRect(renderer_, &rect) != 0)
if (SDL_RenderFillRect(renderer_, &rect) != 0)
throw Exception("SDL_RenderFillRect failed");
}
@ -173,7 +173,7 @@ void Renderer::FillRect(const Point& p1, const Point& p2) {
void Renderer::FillRect(const Rect& r) {
if (r.IsNull())
return;
if (SDL_RenderDrawRect(renderer_, r.Get()) != 0)
if (SDL_RenderFillRect(renderer_, r.Get()) != 0)
throw Exception("SDL_RenderFillRect failed");
}