---
name: "SDL_GetSurfaceImages"
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_GetSurfaceImages"
---

# SDL\_GetSurfaceImages(3)

Get an array including all versions of a surface.

## NAME

SDL\_GetSurfaceImages - Get an array including all versions of a surface.

## HEADER FILE

Defined in SDL3/SDL\_surface.h

## SYNOPSIS

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

**SDL\_Surface \*\* SDL\_GetSurfaceImages(SDL\_Surface \*surface, int \*count);**

## DESCRIPTION

This returns all versions of a surface, with the surface being queried as the first element in the returned array.

Freeing the array of surfaces does not affect the surfaces in the array. They are still referenced by the surface being queried and will be cleaned up normally.

## FUNCTION PARAMETERS

- *surface*

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

- *count*

  a pointer filled in with the number of surface pointers returned, may be NULL.

## RETURN VALUE

( **SDL\_Surface** *) Returns a NULL terminated array of*

**SDL\_Surface**\
  pointers or NULL on failure; call

**SDL\_GetError** () for more information. This should be freed with  **SDL\_free** () when it is no longer needed.

## THREAD SAFETY

This function is not thread safe.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

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