---
name: "SDL_SetRenderClipRect"
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_SetRenderClipRect"
---

# SDL\_SetRenderClipRect(3)

Set the clip rectangle for rendering on the specified target.

## NAME

SDL\_SetRenderClipRect - Set the clip rectangle for rendering on the specified target.

## HEADER FILE

Defined in SDL3/SDL\_render.h

## SYNOPSIS

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

**bool SDL\_SetRenderClipRect(SDL\_Renderer \*renderer, const SDL\_Rect \*rect);**

## DESCRIPTION

Each render target has its own clip rectangle. This function sets the cliprect for the current render target.

## FUNCTION PARAMETERS

- *renderer*

  the rendering context.

- *rect*

  an  **SDL\_Rect**\
    structure representing the clip area, relative to the viewport, or NULL to disable clipping.

## RETURN VALUE

Returns true on success or false on failure; call

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

## THREAD SAFETY

This function should only be called on the main thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetRenderClipRect**(3)](/SDL_GetRenderClipRect/3.md), **•**(3), [**SDL\_RenderClipEnabled**(3)](/SDL_RenderClipEnabled/3.md)
