Add convenience getters

This commit is contained in:
Georg Hagen
2025-08-21 23:56:11 +02:00
parent 19e85b86c9
commit 64459b7a93
2 changed files with 50 additions and 7 deletions

View File

@@ -35,16 +35,22 @@ namespace OpenVulkano::Input
[[nodiscard]] InputAction* GetAction(const std::string& actionName);
[[nodiscard]] float GetAxis(const InputAction& action) const { return GetAxis(&action); }
[[nodiscard]] float GetAxis(const InputAction* action) const;
[[nodiscard]] float GetAxis(InputKey key) const;
[[nodiscard]] bool GetButton(InputAction* action) const;
[[nodiscard]] bool GetButtonDown(InputAction* action) const;
[[nodiscard]] bool GetButton(const InputAction& action) const { return GetButton(&action); }
[[nodiscard]] bool GetButton(const InputAction* action) const;
[[nodiscard]] bool GetButton(InputKey key) const;
[[nodiscard]] bool GetButtonUp(const InputAction& action) const { return GetButtonUp(&action); }
[[nodiscard]] bool GetButtonUp(const InputAction* action) const;
[[nodiscard]] bool GetButtonUp(InputKey key) const;
[[nodiscard]] bool GetButtonDown(const InputAction& action) const { return GetButtonDown(&action); }
[[nodiscard]] bool GetButtonDown(const InputAction* action) const;
[[nodiscard]] bool GetButtonDown(InputKey key) const;
[[nodiscard]] InputDevice* GetDevice(InputDeviceType type) const;
[[nodiscard]] std::vector<InputDevice*> GetDevices(InputDeviceType type) const;