---
name: "SDL_HasRectIntersection"
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_HasRectIntersection"
---

# SDL\_HasRectIntersection(3)

Determine whether two rectangles intersect.

## NAME

SDL\_HasRectIntersection - Determine whether two rectangles intersect.

## HEADER FILE

Defined in SDL3/SDL\_rect.h

## SYNOPSIS

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

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

## DESCRIPTION

If either pointer is NULL the function will return false.

## FUNCTION PARAMETERS

- *A*

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

- *B*

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

## RETURN VALUE

Returns true if there is an intersection, false otherwise.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetRectIntersection**(3)](/SDL_GetRectIntersection/3.md)
