Fixed return value for SDL_CreateRenderer()
authorSam Lantinga <slouken@libsdl.org>
Sun, 15 Mar 2009 15:50:18 +0000
changeset 3091 32efcc94b3da
parent 3090 37f9304df6a9
child 3092 cad1aefa2ed9
Fixed return value for SDL_CreateRenderer()
include/SDL_video.h
src/video/SDL_video.c
--- a/include/SDL_video.h	Thu Mar 12 03:51:39 2009 +0000
+++ b/include/SDL_video.h	Sun Mar 15 15:50:18 2009 +0000
@@ -814,8 +814,7 @@
  * \param index The index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags.
  * \param flags SDL_RendererFlags
  *
- * \return 0 on success, -1 if the flags were not supported, or -2 if
- *         there isn't enough memory to support the requested flags
+ * \return 0 on success, -1 if there was an error creating the renderer.
  *
  * \sa SDL_SelectRenderer()
  * \sa SDL_GetRendererInfo()
--- a/src/video/SDL_video.c	Thu Mar 12 03:51:39 2009 +0000
+++ b/src/video/SDL_video.c	Sun Mar 15 15:50:18 2009 +0000
@@ -1456,7 +1456,8 @@
     SDL_Window *window = SDL_GetWindowFromID(windowID);
 
     if (!window) {
-        return 0;
+        SDL_SetError("Invalid window ID");
+        return -1;
     }
     if (index < 0) {
         const char *override = SDL_getenv("SDL_VIDEO_RENDERER");