* Get the current state of this sensor */
| 372 | * Get the current state of this sensor |
| 373 | */ |
| 374 | int |
| 375 | SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values) |
| 376 | { |
| 377 | if (!SDL_PrivateSensorValid(sensor)) { |
| 378 | return -1; |
| 379 | } |
| 380 | |
| 381 | num_values = SDL_min(num_values, SDL_arraysize(sensor->data)); |
| 382 | SDL_memcpy(data, sensor->data, num_values*sizeof(*data)); |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | /* |
| 387 | * Close a sensor previously opened with SDL_SensorOpen() |
nothing calls this directly
no test coverage detected