diff options
Diffstat (limited to 'src/engine/engine.cpp')
-rw-r--r-- | src/engine/engine.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index e463f28..c988c33 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -2,6 +2,7 @@ #include "util/function.hpp" +#include <thread> #include <utility> CLIGameEngine::CLIGameEngine(IGameFactory game_factory, ISceneFactory scene_factory, @@ -38,7 +39,16 @@ void CLIGameEngine::start() noexcept _configure_input(game->get_input_config()); - _input_handler->listen(); + std::thread listen_input_thread(normalize_lambda( + [this]() + { + _input_handler->listen(); + })); + + while (true) + { + game->on_update(); + } } void CLIGameEngine::_configure_input( |