11#ifndef INCGUARD_MGL_IOKIT_HID_DRIVER_H_1610354956
12#define INCGUARD_MGL_IOKIT_HID_DRIVER_H_1610354956
15#if defined(MGL_GAMEPAD_DELEGATE_ENABLE_IOKIT_HID)
19#include <IOKit/hid/IOHIDManager.h>
24namespace MGL::Input::IOKitHID
30 virtual ~GamepadDriver() noexcept = default;
40 virtual
bool Initialize(IOHIDDeviceRef device) noexcept = 0;
51 virtual
bool UpdateState(MGL::Input::PadState &state, IOHIDDeviceRef device) noexcept = 0;
64template <class DriverClass>
65STL::unique_ptr<GamepadDriver> MakeGamepadDriver(int32_t vendorID, int32_t productID) noexcept
67 if (DriverClass::IsManageable(vendorID, productID))
69 return STL::make_unique<DriverClass>();
76using MakeGamepadDriverFunction = STL::unique_ptr<GamepadDriver> (*)(int32_t vendorID, int32_t productID);