various cleanup
This commit is contained in:
@@ -14,52 +14,25 @@ namespace OpenEngine {
|
||||
class Input
|
||||
{
|
||||
public:
|
||||
virtual ~Input() = default;
|
||||
Input(const Input&) = delete;
|
||||
Input& operator=(const Input&) = delete;
|
||||
static bool IsKeyPressed(KeyCode keycode);
|
||||
|
||||
inline static bool IsKeyPressed(KeyCode keycode) { return instance->IsKeyPressedImpl(keycode); };
|
||||
static bool IsMouseButtonPressed(MouseCode button);
|
||||
|
||||
inline static bool IsMouseButtonPressed(MouseCode button) { return instance->IsMouseButtonPressedImpl(button); };
|
||||
static std::pair<float, float> GetMousePosition();
|
||||
static float GetMouseX();
|
||||
static float GetMouseY();
|
||||
|
||||
inline static std::pair<float, float> GetMousePosition() { return instance->GetMousePositionImpl(); };
|
||||
inline static bool GetMouseX() { return instance->GetMouseXImpl(); };
|
||||
inline static bool GetMouseY() { return instance->GetMouseYImpl(); };
|
||||
static bool JoystickExists(unsigned int joystick);
|
||||
static std::map<unsigned int, std::string> GetJoystickList();
|
||||
|
||||
inline static bool JoystickExists(unsigned int joystick) { return instance->JoystickExistsImpl(joystick); };
|
||||
inline static std::map<unsigned int, std::string> GetJoystickList() { return instance->GetJoystickListImpl(); };
|
||||
static float GetJoystickAxis(unsigned int joystick, unsigned int axis);
|
||||
static const float* GetJoystickAxes(unsigned int joystick);
|
||||
static unsigned int GetJoystickAxesCount(unsigned int joystick);
|
||||
|
||||
inline static float GetJoystickAxis(unsigned int joystick, unsigned int axis) { return instance->GetJoystickAxisImpl(joystick, axis); };
|
||||
inline static const float* GetJoystickAxes(unsigned int joystick) { return instance->GetJoystickAxesImpl(joystick); };
|
||||
inline static unsigned int GetJoystickAxesCount(unsigned int joystick) { return instance->GetJoystickAxesCountImpl(joystick); };
|
||||
|
||||
inline static bool IsJoystickButtonPressed(unsigned int joystick, unsigned int button) { return instance->IsJoystickButtonPressedImpl(joystick, button); };
|
||||
|
||||
protected:
|
||||
Input() = default;
|
||||
|
||||
virtual bool IsKeyPressedImpl(KeyCode keycode) = 0;
|
||||
|
||||
virtual bool IsMouseButtonPressedImpl(MouseCode button) = 0;
|
||||
|
||||
virtual std::pair<float, float> GetMousePositionImpl() = 0;
|
||||
virtual float GetMouseXImpl() = 0;
|
||||
virtual float GetMouseYImpl() = 0;
|
||||
|
||||
virtual bool JoystickExistsImpl(unsigned int joystick) = 0;
|
||||
virtual std::map<unsigned int, std::string> GetJoystickListImpl() = 0;
|
||||
virtual const std::string GetJoystickNameImpl(unsigned int joystick) = 0;
|
||||
|
||||
virtual float GetJoystickAxisImpl(unsigned int joystick, unsigned int axis) = 0;
|
||||
virtual const float* GetJoystickAxesImpl(unsigned int joystick) = 0;
|
||||
virtual unsigned int GetJoystickAxesCountImpl(unsigned int joystick) = 0;
|
||||
|
||||
virtual bool IsJoystickButtonPressedImpl(unsigned int joystick, unsigned int button) = 0;
|
||||
static bool IsJoystickButtonPressed(unsigned int joystick, unsigned int button);
|
||||
|
||||
private:
|
||||
inline static const std::string GetJoystickName(unsigned int joystick) { return instance->GetJoystickNameImpl(joystick); };
|
||||
|
||||
static Scope<Input> instance;
|
||||
static const std::string GetJoystickName(unsigned int joystick);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user