Re-added a simplified version of SDL_SetWindowShape()

In order to handle mouse click transparency this needs to be implemented inside SDL
This commit is contained in:
Sam Lantinga 2024-02-09 07:09:59 -08:00
parent 1143bdc351
commit f6b92c9b88
33 changed files with 128676 additions and 59 deletions

View file

@ -348,6 +348,7 @@ int SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *v
property = (SDL_Property *)SDL_calloc(1, sizeof(*property));
if (!property) {
SDL_FreePropertyWithCleanup(NULL, property, NULL, SDL_FALSE);
return -1;
}
property->type = SDL_PROPERTY_TYPE_POINTER;
@ -374,6 +375,17 @@ int SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value)
return SDL_PrivateSetProperty(props, name, property);
}
static void CleanupSurface(void *userdata, void *value)
{
SDL_Surface *surface = (SDL_Surface *)value;
SDL_DestroySurface(surface);
}
int SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surface *surface)
{
return SDL_SetPropertyWithCleanup(props, name, surface, CleanupSurface, NULL);
}
int SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value)
{