DOKK / manpages / debian 13 / libsdl3-doc / SDL_AddSurfaceAlternateImage.3.en
SDL_AddSurfaceAlternateImage(3) SDL3 FUNCTIONS SDL_AddSurfaceAlternateImage(3)

SDL_AddSurfaceAlternateImage - Add an alternate version of a surface.

Defined in SDL3/SDL_surface.h

#include "SDL3/SDL.h"
bool SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image);

This function adds an alternate version of this surface, usually used for content with high DPI representations like cursors or icons. The size, format, and content do not need to match the original surface, and these alternate versions will not be updated when the original surface changes.

This function adds a reference to the alternate version, so you should call

SDL_DestroySurface () on the image after this call.

the SDL_Surface
structure to update.
a pointer to an alternate SDL_Surface
to associate with this surface.

Returns true on success or false on failure; call

SDL_GetError () for more information.

This function is not thread safe.

This function is available since SDL 3.2.0.

(3), SDL_RemoveSurfaceAlternateImages(3), (3), SDL_GetSurfaceImages(3), (3), SDL_SurfaceHasAlternateImages(3)

SDL 3.2.10 Simple Directmedia Layer