Add Tick method to input device
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace OpenVulkano::Input
|
||||
public:
|
||||
~InputDevice() override = default;
|
||||
|
||||
virtual void Tick() {}
|
||||
|
||||
void Close() override
|
||||
{
|
||||
this->deviceType = InputDeviceType::UNKNOWN;
|
||||
|
||||
@@ -79,4 +79,12 @@ namespace OpenVulkano::Input
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void InputManager::Tick()
|
||||
{
|
||||
for(InputDevice* device : devices)
|
||||
{
|
||||
device->Tick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace OpenVulkano::Input
|
||||
public:
|
||||
static InputManager* GetInstance();
|
||||
|
||||
void Tick();
|
||||
|
||||
void RegisterInputDevice(InputDevice* device)
|
||||
{
|
||||
devices.push_back(device);
|
||||
|
||||
Reference in New Issue
Block a user