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 5331 16bc7591f8c8
parent 5330 874c671c8043
child 5332 ae8b6fb1feaf
Fixed SDL_RenderClear() if the render driver doesn't implement it.
src/render/SDL_render.c
--- a/src/render/SDL_render.c	Thu Feb 17 02:16:30 2011 -0800
+++ b/src/render/SDL_render.c	Thu Feb 17 02:17:38 2011 -0800
@@ -930,8 +930,6 @@
 
     /* 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 @@
 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);
 }