sdlGameControllerMapping function

Pointer<Int8> sdlGameControllerMapping(
  1. Pointer<SdlGameController> gamecontroller
)

Get the current mapping of a Game Controller.

The returned string must be freed with SDL_free().

Details about mappings are discussed with SDL_GameControllerAddMapping().

\param gamecontroller the game controller you want to get the current mapping for \returns a string that has the controller's mapping or NULL if no mapping is available; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_GameControllerAddMapping \sa SDL_GameControllerMappingForGUID

extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller)

Implementation

Pointer<Int8> sdlGameControllerMapping(
    Pointer<SdlGameController> gamecontroller) {
  final sdlGameControllerMappingLookupFunction = libSdl2.lookupFunction<
          Pointer<Int8> Function(Pointer<SdlGameController> gamecontroller),
          Pointer<Int8> Function(Pointer<SdlGameController> gamecontroller)>(
      'SDL_GameControllerMapping');
  return sdlGameControllerMappingLookupFunction(gamecontroller);
}