Mercurial > sdl-ios-xcode
changeset 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 | b29eb7ce5352 |
children | 63d4517fc4ac |
files | src/video/SDL_video.c |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
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; }