# HG changeset patch # User Sam Lantinga # Date 1253960555 0 # Node ID f085091f74cda00d1d4b79508f40b5eaadf15597 # Parent b29eb7ce53527a03b8d5323efabc2b6011981938 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. diff -r b29eb7ce5352 -r f085091f74cd src/video/SDL_video.c --- 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; }