---
name: "SDL_GetSurfaceClipRect"
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_GetSurfaceClipRect"
---

# SDL\_GetSurfaceClipRect(3)

Get the clipping rectangle for a surface.

## NAME

SDL\_GetSurfaceClipRect - Get the clipping rectangle for a surface.

## HEADER FILE

Defined in SDL3/SDL\_surface.h

## SYNOPSIS

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

**bool SDL\_GetSurfaceClipRect(SDL\_Surface \*surface, SDL\_Rect \*rect);**

## DESCRIPTION

When **surface** is the destination of a blit, only the area within the clip rectangle is drawn into.

## FUNCTION PARAMETERS

- *surface*

  the  **SDL\_Surface**\
    structure representing the surface to be clipped.

- *rect*

  an  **SDL\_Rect**\
    structure filled in with the clipping rectangle for the 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\_SetSurfaceClipRect**(3)](/SDL_SetSurfaceClipRect/3.md)
