|
|
@@ -5,6 +5,7 @@
|
|
|
|
|
|
#include <cycle/Engine.hpp>
|
|
|
#include <factory/KeyboardFactory.hpp>
|
|
|
+#include <factory/WindowApiEventManagerFactory.hpp>
|
|
|
#include <factory/WindowApiFactory.hpp>
|
|
|
#include <messaging/StatusCodeOk.hpp>
|
|
|
|
|
|
@@ -12,6 +13,7 @@ using ls::atlantis::cycle::Engine;
|
|
|
using ls::atlantis::cycle::EngineParameter;
|
|
|
using ls::atlantis::cycle::EngineRuntimeData;
|
|
|
using ls::atlantis::factory::KeyboardFactory;
|
|
|
+using ls::atlantis::factory::WindowApiEventManagerFactory;
|
|
|
using ls::atlantis::factory::WindowApiFactory;
|
|
|
using ls::atlantis::interfaces::AStatusCode;
|
|
|
using ls::atlantis::messaging::StatusCodeOk;
|
|
|
@@ -27,9 +29,9 @@ Engine::Engine(const EngineParameter &_parameter)
|
|
|
|
|
|
Engine::~Engine() = default;
|
|
|
|
|
|
-void Engine::beginFrame()
|
|
|
+void Engine::beginFrame() const
|
|
|
{
|
|
|
-
|
|
|
+ this->data->getWindowApiEventManager()->manage();
|
|
|
}
|
|
|
|
|
|
void Engine::endFrame() const
|
|
|
@@ -51,6 +53,11 @@ shared_ptr<AStatusCode> Engine::init() const
|
|
|
result = this->_initKeyboard();
|
|
|
}
|
|
|
|
|
|
+ if (result->getCode() == StatusCodeOk().getCode())
|
|
|
+ {
|
|
|
+ result = this->_initEventManager();
|
|
|
+ }
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -64,6 +71,14 @@ void Engine::quit() const
|
|
|
this->data->setIsUp(false);
|
|
|
}
|
|
|
|
|
|
+shared_ptr<AStatusCode> Engine::_initEventManager() const
|
|
|
+{
|
|
|
+ const auto eventManager = WindowApiEventManagerFactory::build(this->parameter.getWindowApiType());
|
|
|
+ this->data->setWindowApiEventManager(eventManager);
|
|
|
+
|
|
|
+ return make_shared<StatusCodeOk>();
|
|
|
+}
|
|
|
+
|
|
|
shared_ptr<AStatusCode> Engine::_initKeyboard() const
|
|
|
{
|
|
|
const auto keyboard = KeyboardFactory::build(this->parameter.getWindowApiType());
|