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