toGameControllerButton method

GameControllerButton toGameControllerButton(
  1. Sdl sdl
)

Get a game controller button.

SDL Docs

Implementation

GameControllerButton toGameControllerButton(final Sdl sdl) {
  final ptr = toCharPointer();
  final i = sdl.sdl.SDL_GameControllerGetButtonFromString(ptr);
  malloc.free(ptr);
  final v = i.toGameControllerButton();
  if (v == GameControllerButton.invalid) {
    throw SdlError(0, 'Invalid game controller button "$this".');
  }
  return v;
}