---
name: "SDL_GetRectEnclosingPoints"
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_GetRectEnclosingPoints"
---

# SDL\_GetRectEnclosingPoints(3)

Calculate a minimal rectangle enclosing a set of points.

## NAME

SDL\_GetRectEnclosingPoints - Calculate a minimal rectangle enclosing a set of points.

## HEADER FILE

Defined in SDL3/SDL\_rect.h

## SYNOPSIS

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

**bool SDL\_GetRectEnclosingPoints(const SDL\_Point \*points, int count, const SDL\_Rect \*clip, SDL\_Rect \*result);**

## DESCRIPTION

If **clip** is not NULL then only points inside of the clipping rectangle are considered.

## FUNCTION PARAMETERS

- *points*

  an array of  **SDL\_Point**\
    structures representing points to be enclosed.

- *count*

  the number of structures in the **points** array.

- *clip*

  an  **SDL\_Rect**\
    used for clipping or NULL to enclose all points.

- *result*

  an  **SDL\_Rect**\
    structure filled in with the minimal enclosing rectangle.

## RETURN VALUE

Returns true if any points were enclosed or false if all the points were outside of the clipping rectangle.

## AVAILABILITY

This function is available since SDL 3.2.0.
