mirror of
https://github.com/shadps4-emu/ext-SDL.git
synced 2024-11-24 02:29:43 +00:00
minor cleanup of SDL_CreateRenderer
This commit is contained in:
parent
e8c48981f9
commit
6d5592a201
@ -930,7 +930,7 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags)
|
||||
#endif
|
||||
|
||||
if (!window) {
|
||||
SDL_SetError("Invalid window");
|
||||
SDL_InvalidParamError("window");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -979,24 +979,24 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (index == n) {
|
||||
if (!renderer) {
|
||||
SDL_SetError("Couldn't find matching render driver");
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
if (index >= SDL_GetNumRenderDrivers()) {
|
||||
if (index >= n) {
|
||||
SDL_SetError("index must be -1 or in the range of 0 - %d",
|
||||
SDL_GetNumRenderDrivers() - 1);
|
||||
n - 1);
|
||||
goto error;
|
||||
}
|
||||
/* Create a new renderer instance */
|
||||
renderer = render_drivers[index]->CreateRenderer(window, flags);
|
||||
batching = SDL_FALSE;
|
||||
if (!renderer) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!renderer) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
VerifyDrawQueueFunctions(renderer);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user