sdlGetGamepadMapping function

Pointer<Int8> sdlGetGamepadMapping(
  1. Pointer<SdlGamepad> gamepad
)

Get the current mapping of a gamepad.

Details about mappings are discussed with SDL_AddGamepadMapping().

\param gamepad the gamepad you want to get the current mapping for. \returns a string that has the gamepad's mapping or NULL if no mapping is available; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.

\since This function is available since SDL 3.1.3.

\sa SDL_AddGamepadMapping \sa SDL_GetGamepadMappingForID \sa SDL_GetGamepadMappingForGUID \sa SDL_SetGamepadMapping

extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad)

Implementation

Pointer<Int8> sdlGetGamepadMapping(Pointer<SdlGamepad> gamepad) {
  final sdlGetGamepadMappingLookupFunction = libSdl3.lookupFunction<
      Pointer<Int8> Function(Pointer<SdlGamepad> gamepad),
      Pointer<Int8> Function(
          Pointer<SdlGamepad> gamepad)>('SDL_GetGamepadMapping');
  return sdlGetGamepadMappingLookupFunction(gamepad);
}