Input events moved from InputSystem to new InputManager

This commit is contained in:
2014-05-05 07:16:45 +02:00
parent 330a212830
commit 5e7537b903
12 changed files with 236 additions and 103 deletions
+7 -2
View File
@@ -2,8 +2,9 @@
#include <sstream>
#include "EventBroker.h"
#include "GUI/Frame.h"
#include "Renderer.h"
#include "InputManager.h"
#include "GUI/Frame.h"
#include "GameWorld.h"
class Engine
@@ -16,7 +17,9 @@ public:
m_Renderer = std::make_shared<Renderer>();
m_Renderer->Initialize();
m_UIParent = std::make_shared<GUI::Frame>(0, 0, m_Renderer->Width(), m_Renderer->Height());
m_InputManager = std::make_shared<InputManager>(m_Renderer->GetWindow(), m_EventBroker);
m_UIParent = std::make_shared<GUI::Frame>(m_EventBroker);
m_World = std::make_shared<GameWorld>(m_EventBroker, m_Renderer);
m_World->Initialize();
@@ -32,6 +35,7 @@ public:
double dt = currentTime - m_LastTime;
m_LastTime = currentTime;
m_InputManager->Update(dt);
m_World->Update(dt);
m_Renderer->Draw(dt);
@@ -41,6 +45,7 @@ public:
private:
std::shared_ptr<EventBroker> m_EventBroker;
std::shared_ptr<Renderer> m_Renderer;
std::shared_ptr<InputManager> m_InputManager;
std::shared_ptr<GUI::Frame> m_UIParent;
// TODO: This should ultimately live in GameFrame
std::shared_ptr<GameWorld> m_World;