Cleanup input stuff

This commit is contained in:
2023-10-12 12:13:14 +02:00
parent 31eef79f22
commit b2ec209ef0
6 changed files with 533 additions and 486 deletions

View File

@@ -0,0 +1,48 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <string>
#include <vector>
namespace OpenVulkano::Input
{
class InputDevice;
class BaseInputAction
{
std::string m_name;
std::vector<InputDevice*> m_devices;
bool m_enabled;
protected:
BaseInputAction(const std::string& name) : m_name(name), m_enabled(true) {}
public:
virtual ~BaseInputAction() = default;
[[nodiscard]] const std::string& GetName() const
{
return m_name;
}
[[nodiscard]] const std::vector<InputDevice*>& GetDevices() const
{
return m_devices;
}
[[nodiscard]] bool IsEnabled() const
{
return m_enabled;
}
void SetEnabled(bool enabled)
{
m_enabled = enabled;
}
};
}