11#ifndef INCGUARD_MGL_GAMEPAD_DELEGATE_APPLE_GC_H_1664004796
12#define INCGUARD_MGL_GAMEPAD_DELEGATE_APPLE_GC_H_1664004796
15#if defined(MGL_GAMEPAD_DELEGATE_ENABLE_APPLE_GC)
21#include <GameController/GameController.h>
38class AppleGCGamepadDelegate :
public GamepadDelegate
41 AppleGCGamepadDelegate(GamepadServer &server)
noexcept;
42 ~AppleGCGamepadDelegate() noexcept;
44 virtual
bool Initialize() noexcept override;
45 virtual
void UpdateState() noexcept override;
48 void InitializeAvailableFlags() noexcept;
50 PadType GetPadType(GCController *controller) const noexcept;
52 void OnConnect(GCController *controller) noexcept;
53 void OnDisconnect(GCController *controller) noexcept;
55 void UpdateMFiExtendedPadState(PadState &state, GCController *controller,
bool isRequestedPause) noexcept;
56 void UpdateMFiMicroPadState(PadState &state, GCController *controller,
bool isRequestedPause) noexcept;
57 void UpdateXboxOnePadState(PadState &state, GCController *controller) noexcept;
58 void UpdateDualShock4PadState(PadState &state, GCController *controller) noexcept;
59 void UpdateDualSensePadState(PadState &state, GCController *controller) noexcept;
65 id _disconnectObserver;
67#if defined(MGL_TARGET_TVOS)
77 GCController *controller;
78 std::atomic<bool> isRequestedPause;
80 std::array<Gamepad, kGamepadMax> _gamepads;
83 enum class AvailableFlag
93 static constexpr size_t kAvailableFlagSize =
static_cast<size_t>(AvailableFlag::XboxShareButton) + 1;
94 std::array<bool, kAvailableFlagSize> _availableFlags;
103 constexpr bool IsAvailable(AvailableFlag flag)
const noexcept
105 return _availableFlags[
static_cast<size_t>(flag)];
constexpr size_t kGamepadMax
ゲームパッドの最大認識数
Definition mgl_gamepad_server.h:33