Add Tick method to input device

This commit is contained in:
2023-10-14 18:29:32 +02:00
parent f5337ce6ec
commit 57e4352c6c
4 changed files with 14 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#include "Base/Logger.hpp"
#include "Base/FrameMetadata.hpp"
#include "PlatformProducer.hpp"
#include "Input/InputManager.hpp"
#include <chrono>
#include <thread>
#include <stdexcept>
@@ -128,6 +129,7 @@ namespace OpenVulkano
}
else
{
Input::InputManager::GetInstance()->Tick();
app->Tick();
renderer->Tick();
frameTimer.Tick();

View File

@@ -40,6 +40,8 @@ namespace OpenVulkano::Input
public:
~InputDevice() override = default;
virtual void Tick() {}
void Close() override
{
this->deviceType = InputDeviceType::UNKNOWN;

View File

@@ -79,4 +79,12 @@ namespace OpenVulkano::Input
}
return false;
}
void InputManager::Tick()
{
for(InputDevice* device : devices)
{
device->Tick();
}
}
}

View File

@@ -22,6 +22,8 @@ namespace OpenVulkano::Input
public:
static InputManager* GetInstance();
void Tick();
void RegisterInputDevice(InputDevice* device)
{
devices.push_back(device);