Module sensor
Available on crate feature
dep_sdl3
only.Expand description
SDL sensor management.
These APIs grant access to gyros and accelerometers on various platforms.
In order to use these functions, [SDL_Init()
] must have been called with the
[SDL_INIT_SENSOR
] flag. This causes SDL to scan the system for sensors, and
load appropriate drivers.
Structs§
- SDL_
Sensor - The opaque structure used to identify an opened SDL sensor.
- SDL_
Sensor Type - The different sensors defined by SDL.
Constants§
- SDL_
SENSOR_ ACCEL - Accelerometer
- SDL_
SENSOR_ ACCEL_ L - Accelerometer for left Joy-Con controller and Wii nunchuk
- SDL_
SENSOR_ ACCEL_ R - Accelerometer for right Joy-Con controller
- SDL_
SENSOR_ GYRO - Gyroscope
- SDL_
SENSOR_ GYRO_ L - Gyroscope for left Joy-Con controller
- SDL_
SENSOR_ GYRO_ R - Gyroscope for right Joy-Con controller
- SDL_
SENSOR_ INVALID - Returned for an invalid sensor
- SDL_
SENSOR_ UNKNOWN - Unknown sensor type
- SDL_
STANDARD_ GRAVITY - A constant to represent standard gravity for accelerometer sensors.
Functions§
- SDL_
Close ⚠Sensor - Close a sensor previously opened with
SDL_OpenSensor()
. - SDL_
GetSensor ⚠Data - Get the current state of an opened sensor.
- SDL_
GetSensor ⚠FromID - Return the
SDL_Sensor
associated with an instance ID. - SDL_
GetSensorID ⚠ - Get the instance ID of a sensor.
- SDL_
GetSensor ⚠Name - Get the implementation dependent name of a sensor.
- SDL_
GetSensor ⚠Name ForID - Get the implementation dependent name of a sensor.
- SDL_
GetSensor ⚠NonPortable Type - Get the platform dependent type of a sensor.
- SDL_
GetSensor ⚠NonPortable Type ForID - Get the platform dependent type of a sensor.
- SDL_
GetSensor ⚠Properties - Get the properties associated with a sensor.
- SDL_
GetSensor ⚠Type - Get the type of a sensor.
- SDL_
GetSensor ⚠Type ForID - Get the type of a sensor.
- SDL_
GetSensors ⚠ - Get a list of currently connected sensors.
- SDL_
Open ⚠Sensor - Open a sensor for use.
- SDL_
Update ⚠Sensors - Update the current state of the open sensors.
Type Aliases§
- SDL_
SensorID - This is a unique ID for a sensor for the time it is connected to the system, and is never reused for the lifetime of the application.