* Count the number of sensors attached to the system */
| 94 | * Count the number of sensors attached to the system |
| 95 | */ |
| 96 | int |
| 97 | SDL_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 |