Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed SDL_RenderClear() if the render driver doesn't implement it.

  • Loading branch information
slouken committed Feb 17, 2011
1 parent 7cd4f75 commit 64e542f7742cf0e623313ed7f7dd4f4fc77dc66c
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/render/SDL_render.c
@@ -930,8 +930,6 @@ SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect)

/* If 'rect' == NULL, then outline the whole surface */
if (!rect) {
SDL_Window *window = renderer->window;

full_rect.x = 0;
full_rect.y = 0;
full_rect.w = renderer->viewport.w;
@@ -979,6 +977,18 @@ SDL_RenderDrawRects(SDL_Renderer * renderer,
int
SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect)
{
SDL_Rect full_rect;

CHECK_RENDERER_MAGIC(renderer, -1);

/* If 'rect' == NULL, then outline the whole surface */
if (!rect) {
full_rect.x = 0;
full_rect.y = 0;
full_rect.w = renderer->viewport.w;
full_rect.h = renderer->viewport.h;
rect = &full_rect;
}
return SDL_RenderFillRects(renderer, rect, 1);
}

0 comments on commit 64e542f

Please sign in to comment.