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

Function SDL_SensorFromInstanceID

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

* Find the SDL_Sensor that owns this instance id */

Source from the content-addressed store, hash-verified

284 * Find the SDL_Sensor that owns this instance id
285 */
286SDL_Sensor *
287SDL_SensorFromInstanceID(SDL_SensorID instance_id)
288{
289 SDL_Sensor *sensor;
290
291 SDL_LockSensors();
292 for (sensor = SDL_sensors; sensor; sensor = sensor->next) {
293 if (sensor->instance_id == instance_id) {
294 break;
295 }
296 }
297 SDL_UnlockSensors();
298 return sensor;
299}
300
301/*
302 * Checks to make sure the sensor is valid.

Callers 1

HandleSensorEventFunction · 0.85

Calls 2

SDL_LockSensorsFunction · 0.85
SDL_UnlockSensorsFunction · 0.85

Tested by 1

HandleSensorEventFunction · 0.68