sdlGameControllerGetSensorData function

int sdlGameControllerGetSensorData(
  1. Pointer<SdlGameController> gamecontroller,
  2. int type,
  3. Pointer<Float> data,
  4. int numValues,
)

Get the current state of a game controller sensor.

The number of values and interpretation of the data is sensor dependent. See SDL_sensor.h for the details for each type of sensor.

\param gamecontroller The controller to query \param type The type of sensor to query \param data A pointer filled with the current sensor state \param num_values The number of values to write to data \return 0 or -1 if an error occurred.

\since This function is available since SDL 2.0.14.

extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values)

Implementation

int sdlGameControllerGetSensorData(Pointer<SdlGameController> gamecontroller,
    int type, Pointer<Float> data, int numValues) {
  final sdlGameControllerGetSensorDataLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlGameController> gamecontroller, Int32 type,
          Pointer<Float> data, Int32 numValues),
      int Function(
          Pointer<SdlGameController> gamecontroller,
          int type,
          Pointer<Float> data,
          int numValues)>('SDL_GameControllerGetSensorData');
  return sdlGameControllerGetSensorDataLookupFunction(
      gamecontroller, type, data, numValues);
}