2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2015-08-28 00:11:31 +00:00
|
|
|
|
2022-03-20 04:19:43 +00:00
|
|
|
#include "Runtime/Input/InputTypes.hpp"
|
|
|
|
#include "Runtime/Input/CControllerGamepadData.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2015-08-28 00:11:31 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class IController {
|
2022-03-20 04:19:43 +00:00
|
|
|
protected:
|
|
|
|
static constexpr float kAbsoluteMinimum = -1.f;
|
|
|
|
static constexpr float kAbsoluteMaximum = 1.f;
|
|
|
|
static constexpr float kRelativeMinimum = -1.f;
|
|
|
|
static constexpr float kRelativeMaximum = 1.f;
|
2015-08-28 00:11:31 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
virtual void Poll() = 0;
|
2022-03-20 04:19:43 +00:00
|
|
|
virtual u32 GetDeviceCount() const = 0;
|
|
|
|
virtual CControllerGamepadData& GetGamepadData(u32 controller) = 0;
|
|
|
|
virtual u32 GetControllerType(u32 controller) const = 0;
|
|
|
|
virtual void SetMotorState(EIOPort port, EMotorState state) = 0;
|
|
|
|
|
|
|
|
static IController* Create();
|
2015-08-28 00:11:31 +00:00
|
|
|
};
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|