MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_NumSensors

Function SDL_NumSensors

deps/SDL2/src/sensor/SDL_sensor.c:96–106  ·  view source on GitHub ↗

* Count the number of sensors attached to the system */

Source from the content-addressed store, hash-verified

94 * Count the number of sensors attached to the system
95 */
96int
97SDL_NumSensors(void)
98{
99 int i, total_sensors = 0;
100 SDL_LockSensors();
101 for (i = 0; i < SDL_arraysize(SDL_sensor_drivers); ++i) {
102 total_sensors += SDL_sensor_drivers[i]->GetCount();
103 }
104 SDL_UnlockSensors();
105 return total_sensors;
106}
107
108/*
109 * Return the next available sensor instance ID

Callers 1

mainFunction · 0.85

Calls 2

SDL_LockSensorsFunction · 0.85
SDL_UnlockSensorsFunction · 0.85

Tested by 1

mainFunction · 0.68