---
name: "SDL_AddSurfaceAlternateImage"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_AddSurfaceAlternateImage"
---

# SDL\_AddSurfaceAlternateImage(3)

Add an alternate version of a surface.

## NAME

SDL\_AddSurfaceAlternateImage - Add an alternate version of a surface.

## HEADER FILE

Defined in SDL3/SDL\_surface.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_AddSurfaceAlternateImage(SDL\_Surface \*surface, SDL\_Surface \*image);**

## DESCRIPTION

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.

## FUNCTION PARAMETERS

- *surface*

  the  **SDL\_Surface**\
    structure to update.

- *image*

  a pointer to an alternate  **SDL\_Surface**\
    to associate with this surface.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

This function is not thread safe.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_RemoveSurfaceAlternateImages**(3)](/SDL_RemoveSurfaceAlternateImages/3.md), **•**(3), [**SDL\_GetSurfaceImages**(3)](/SDL_GetSurfaceImages/3.md), **•**(3), [**SDL\_SurfaceHasAlternateImages**(3)](/SDL_SurfaceHasAlternateImages/3.md)
