sdlGameControllerMappingForDeviceIndex function

Pointer<Int8> sdlGameControllerMappingForDeviceIndex(
  1. int joystickIndex
)

Get the mapping of a game controller.

This can be called before any controllers are opened.

\param joystick_index the device_index of a device, from zero to SDL_NumJoysticks()-1 \returns the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available.

\since This function is available since SDL 2.0.9.

extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index)

Implementation

Pointer<Int8> sdlGameControllerMappingForDeviceIndex(int joystickIndex) {
  final sdlGameControllerMappingForDeviceIndexLookupFunction =
      libSdl2.lookupFunction<
          Pointer<Int8> Function(Int32 joystickIndex),
          Pointer<Int8> Function(
              int joystickIndex)>('SDL_GameControllerMappingForDeviceIndex');
  return sdlGameControllerMappingForDeviceIndexLookupFunction(joystickIndex);
}