sdlGetGamepadMappingForId function gamepad

Pointer<Int8> sdlGetGamepadMappingForId(
  1. int instanceId
)

Get the mapping of a gamepad.

This can be called before any gamepads are opened.

\param instance_id the joystick instance ID. \returns the mapping string. Returns NULL if no mapping is available. This should be freed with SDL_free() when it is no longer needed.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.2.0.

\sa SDL_GetGamepads \sa SDL_GetGamepadMapping

extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id)

Implementation

Pointer<Int8> sdlGetGamepadMappingForId(int instanceId) {
  final sdlGetGamepadMappingForIdLookupFunction = _libSdl
      .lookupFunction<
        Pointer<Int8> Function(Uint32 instanceId),
        Pointer<Int8> Function(int instanceId)
      >('SDL_GetGamepadMappingForID');
  return sdlGetGamepadMappingForIdLookupFunction(instanceId);
}