---
name: "SDL_GetSensorData"
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_GetSensorData"
---

# SDL\_GetSensorData(3)

Get the current state of an opened sensor.

## NAME

SDL\_GetSensorData - Get the current state of an opened sensor.

## HEADER FILE

Defined in SDL3/SDL\_sensor.h

## SYNOPSIS

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

**bool SDL\_GetSensorData(SDL\_Sensor \*sensor, float \*data, int num\_values);**

## DESCRIPTION

The number of values and interpretation of the data is sensor dependent.

## FUNCTION PARAMETERS

- *sensor*

  the  **SDL\_Sensor**\
    object to query.

- *data*

  a pointer filled with the current sensor state.

- *num\_values*

  the number of values to write to data.

## 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.
