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

Function SDL_SensorGetDeviceName

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

* Get the implementation dependent name of a sensor */

Source from the content-addressed store, hash-verified

144 * Get the implementation dependent name of a sensor
145 */
146const char *
147SDL_SensorGetDeviceName(int device_index)
148{
149 SDL_SensorDriver *driver;
150 const char *name = NULL;
151
152 SDL_LockSensors();
153 if (SDL_GetDriverAndSensorIndex(device_index, &driver, &device_index)) {
154 name = driver->GetDeviceName(device_index);
155 }
156 SDL_UnlockSensors();
157
158 /* FIXME: Really we should reference count this name so it doesn't go away after unlock */
159 return name;
160}
161
162SDL_SensorType
163SDL_SensorGetDeviceType(int device_index)

Callers 1

mainFunction · 0.85

Calls 4

SDL_LockSensorsFunction · 0.85
SDL_UnlockSensorsFunction · 0.85
GetDeviceNameMethod · 0.45

Tested by 1

mainFunction · 0.68