toTouchDeviceType method

TouchDeviceType toTouchDeviceType()

Convert from a SDL_TouchDeviceType member.

Implementation

TouchDeviceType toTouchDeviceType() {
  switch (this) {
    case SDL_TouchDeviceType.SDL_TOUCH_DEVICE_INVALID:
      return TouchDeviceType.invalid;
    case SDL_TouchDeviceType.SDL_TOUCH_DEVICE_DIRECT:
      return TouchDeviceType.direct;
    case SDL_TouchDeviceType.SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE:
      return TouchDeviceType.indirectAbsolute;
    case SDL_TouchDeviceType.SDL_TOUCH_DEVICE_INDIRECT_RELATIVE:
      return TouchDeviceType.indirectRelative;
    default:
      throw SdlError(
        this,
        'Unrecognised `SDL_TouchDeviceType` member.',
      );
  }
}