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

Function SDL_SensorGetDeviceInstanceID

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

Source from the content-addressed store, hash-verified

190}
191
192SDL_SensorID
193SDL_SensorGetDeviceInstanceID(int device_index)
194{
195 SDL_SensorDriver *driver;
196 SDL_SensorID instance_id = -1;
197
198 SDL_LockSensors();
199 if (SDL_GetDriverAndSensorIndex(device_index, &driver, &device_index)) {
200 instance_id = driver->GetDeviceInstanceID(device_index);
201 }
202 SDL_UnlockSensors();
203
204 return instance_id;
205}
206
207/*
208 * Open a sensor for use - the index passed as an argument refers to

Callers 1

mainFunction · 0.85

Calls 3

SDL_LockSensorsFunction · 0.85
SDL_UnlockSensorsFunction · 0.85

Tested by 1

mainFunction · 0.68