mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
Return the correct error from SDL_CreateSoftwareRenderer() when the surface is NULL
This commit is contained in:
@@ -1156,6 +1156,11 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface)
|
|||||||
{
|
{
|
||||||
#if SDL_VIDEO_RENDER_SW
|
#if SDL_VIDEO_RENDER_SW
|
||||||
SDL_Renderer *renderer;
|
SDL_Renderer *renderer;
|
||||||
|
|
||||||
|
if (!surface) {
|
||||||
|
SDL_InvalidParamError("surface");
|
||||||
|
}
|
||||||
|
|
||||||
SDL_PropertiesID props = SDL_CreateProperties();
|
SDL_PropertiesID props = SDL_CreateProperties();
|
||||||
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface);
|
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface);
|
||||||
renderer = SDL_CreateRendererWithProperties(props);
|
renderer = SDL_CreateRendererWithProperties(props);
|
||||||
|
Reference in New Issue
Block a user