Fixed SDL_RenderClear() if the render driver doesn't implement it.
authorSam Lantinga <slouken@libsdl.org>
Thu, 17 Feb 2011 02:17:38 -0800
changeset 533116bc7591f8c8
parent 5330 874c671c8043
child 5332 ae8b6fb1feaf
Fixed SDL_RenderClear() if the render driver doesn't implement it.
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Thu Feb 17 02:16:30 2011 -0800
     1.2 +++ b/src/render/SDL_render.c	Thu Feb 17 02:17:38 2011 -0800
     1.3 @@ -930,8 +930,6 @@
     1.4  
     1.5      /* If 'rect' == NULL, then outline the whole surface */
     1.6      if (!rect) {
     1.7 -        SDL_Window *window = renderer->window;
     1.8 -
     1.9          full_rect.x = 0;
    1.10          full_rect.y = 0;
    1.11          full_rect.w = renderer->viewport.w;
    1.12 @@ -979,6 +977,18 @@
    1.13  int
    1.14  SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect)
    1.15  {
    1.16 +    SDL_Rect full_rect;
    1.17 +	
    1.18 +    CHECK_RENDERER_MAGIC(renderer, -1);
    1.19 +	
    1.20 +    /* If 'rect' == NULL, then outline the whole surface */
    1.21 +    if (!rect) {
    1.22 +        full_rect.x = 0;
    1.23 +        full_rect.y = 0;
    1.24 +        full_rect.w = renderer->viewport.w;
    1.25 +        full_rect.h = renderer->viewport.h;
    1.26 +        rect = &full_rect;
    1.27 +    }
    1.28      return SDL_RenderFillRects(renderer, rect, 1);
    1.29  }
    1.30