mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-18 18:58:27 +00:00
Return the correct error from SDL_CreateSoftwareRenderer() when the surface is NULL
This commit is contained in:
parent
f9a06c20ed
commit
c057849035
1 changed files with 5 additions and 0 deletions
|
@ -1156,6 +1156,11 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface)
|
|||
{
|
||||
#if SDL_VIDEO_RENDER_SW
|
||||
SDL_Renderer *renderer;
|
||||
|
||||
if (!surface) {
|
||||
SDL_InvalidParamError("surface");
|
||||
}
|
||||
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface);
|
||||
renderer = SDL_CreateRendererWithProperties(props);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue