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

Function SDL_SensorGetData

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

* Get the current state of this sensor */

Source from the content-addressed store, hash-verified

372 * Get the current state of this sensor
373 */
374int
375SDL_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()

Callers

nothing calls this directly

Calls 2

SDL_PrivateSensorValidFunction · 0.85
SDL_memcpyFunction · 0.85

Tested by

no test coverage detected