* Get the implementation dependent name of a sensor */
| 144 | * Get the implementation dependent name of a sensor |
| 145 | */ |
| 146 | const char * |
| 147 | SDL_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 | |
| 162 | SDL_SensorType |
| 163 | SDL_SensorGetDeviceType(int device_index) |