# HG changeset patch # User Sam Lantinga # Date 1237132218 0 # Node ID 32efcc94b3da3e8543e5d52c947d82d12402e955 # Parent 37f9304df6a990e6f63afb58918efbbc87c3b1c3 Fixed return value for SDL_CreateRenderer() diff -r 37f9304df6a9 -r 32efcc94b3da include/SDL_video.h --- 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() diff -r 37f9304df6a9 -r 32efcc94b3da src/video/SDL_video.c --- 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");