Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed return value for SDL_CreateRenderer()
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 15, 2009
1 parent ebcbc23 commit 4859664
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions include/SDL_video.h
Expand Up @@ -814,8 +814,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
* \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()
Expand Down
3 changes: 2 additions & 1 deletion src/video/SDL_video.c
Expand Up @@ -1456,7 +1456,8 @@ SDL_CreateRenderer(SDL_WindowID windowID, int index, Uint32 flags)
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");
Expand Down

0 comments on commit 4859664

Please sign in to comment.