int
SDL_CreateRenderer(SDL_WindowID windowID, int index, Uint32 flags)
{
SDL_Window *window = SDL_GetWindowFromID(windowID);
if (!window) {
return 0;
}
But according to the documentation in the .h file,:
- \return 0 on success, -1 if the flags were not supported, or -2 if
-
there isn't enough memory to support the requested flags
If there’s no valid window, it’s certainly not successful. Maybe it should return -3 instead?