mirror of
https://github.com/yawut/SDL.git
synced 2026-08-26 10:44:39 -05:00
Fixed return value for SDL_CreateRenderer()
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user