summary refs log tree commit diff
path: root/src/Game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Game.cpp')
-rw-r--r--src/Game.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Game.cpp b/src/Game.cpp
index 231c681..dd04b2f 100644
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -21,6 +21,9 @@ void Game::run() const {
     World::Clouds clouds{};
     Entities::Player player{{0, World::Chunk::Height / 2.0, 0}};
 
+    Input::register_callbacks(m_window);
+
+    Input input;
     Time time;
 
     while (!m_window.should_close()) {
@@ -33,11 +36,13 @@ void Game::run() const {
 
         time.start_frame();
 
-        if (m_window.key(GLFW_KEY_ESCAPE, GLFW_PRESS)) {
+        input.update(time.frame_start());
+
+        if (input.pressed(Key::Escape)) {
             m_window.close();
         }
 
-        player.update(time, m_window, camera, world);
+        player.update(time, input, camera, world);
         clouds.update(time);
 
         GFX::Actions actions;