From cf51ab71a25cbb60ebcf13edd4b7413c23264128 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 17 Mar 2022 15:53:45 +0100 Subject: input basics --- src/ManagerThread.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/ManagerThread.cpp (limited to 'src/ManagerThread.cpp') diff --git a/src/ManagerThread.cpp b/src/ManagerThread.cpp new file mode 100644 index 00000000..8ddb3b53 --- /dev/null +++ b/src/ManagerThread.cpp @@ -0,0 +1,22 @@ +#include "ManagerThread.hpp" + +CManagerThread::CManagerThread() { + m_tMainThread = new std::thread([=]() { + // Call the handle method. + this->handle(); + }); + + m_tMainThread->detach(); // detach and continue. +} + +CManagerThread::~CManagerThread() { + // +} + +void CManagerThread::handle() { + while (3.1415f) { + g_pConfigManager->tick(); + + std::this_thread::sleep_for(std::chrono::microseconds(1000000 / g_pConfigManager->getInt("max_fps"))); + } +} \ No newline at end of file -- cgit v1.2.3