---
name: "SDL_GetRectUnion"
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_GetRectUnion"
---

# SDL\_GetRectUnion(3)

Calculate the union of two rectangles.

## NAME

SDL\_GetRectUnion - Calculate the union of two rectangles.

## HEADER FILE

Defined in SDL3/SDL\_rect.h

## SYNOPSIS

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

**bool SDL\_GetRectUnion(const SDL\_Rect \*A, const SDL\_Rect \*B, SDL\_Rect \*result);**

## FUNCTION PARAMETERS

- *A*

  an  **SDL\_Rect**\
    structure representing the first rectangle.

- *B*

  an  **SDL\_Rect**\
    structure representing the second rectangle.

- *result*

  an  **SDL\_Rect**\
    structure filled in with the union of rectangles **A** and **B** .

## RETURN VALUE

Returns true on success or false on failure; call

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

## AVAILABILITY

This function is available since SDL 3.2.0.
