diff src/video/SDL_video.c @ 3318:f085091f74cd

Fixed bug #766 Mason Wheeler 2009-07-06 14:29:47 PDT This adds some missing error reporting for SDL_SelectRenderer, and cleans up the logic a little bit.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 26 Sep 2009 10:22:35 +0000
parents 9cf18687b761
children b334b4f7dfa0
line wrap: on
line diff
--- a/src/video/SDL_video.c	Sat Sep 26 10:19:19 2009 +0000
+++ b/src/video/SDL_video.c	Sat Sep 26 10:22:35 2009 +0000
@@ -1501,11 +1501,16 @@
     SDL_Window *window = SDL_GetWindowFromID(windowID);
     SDL_Renderer *renderer;
 
-    if (!window || !window->renderer) {
+    if (!window) {
+        SDL_SetError("Invalid window ID");
         return -1;
     }
     renderer = window->renderer;
-    if (renderer && renderer->ActivateRenderer) {
+    if (!renderer) {
+        SDL_SetError("Renderer hasn't been created yet");
+        return -1;
+    }
+    if (renderer->ActivateRenderer) {
         if (renderer->ActivateRenderer(renderer) < 0) {
             return -1;
         }