diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-25 11:48:39 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-25 11:48:39 +0100 |
commit | 48015cd425b26eb68eb07f4e4b1adf71e81e11b1 (patch) | |
tree | 95725bd476cf92c5749e27c44c5134902dedfc66 /src/example/gameloop.cpp | |
parent | ea7d7ec301968f3a542de93f487f9501b70c0cd4 (diff) |
make format
Diffstat (limited to 'src/example/gameloop.cpp')
-rw-r--r-- | src/example/gameloop.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/example/gameloop.cpp b/src/example/gameloop.cpp index d45b3ce..b8ee9d8 100644 --- a/src/example/gameloop.cpp +++ b/src/example/gameloop.cpp @@ -1,17 +1,16 @@ -#include <iostream> #include "crepe/api/LoopManager.h" #include <crepe/api/EventManager.h> #include <crepe/api/GameObject.h> #include <crepe/api/IKeyListener.h> #include <crepe/api/IMouseListener.h> +#include <iostream> using namespace crepe; class TestKeyListener : public IKeyListener { public: bool on_key_pressed(const KeyPressEvent & event) override { std::cout << "TestKeyListener: Key Pressed - Code: " << static_cast<int>(event.key) << std::endl; - if(event.key == Keycode::ESCAPE){ - + if (event.key == Keycode::ESCAPE) { } return false; } @@ -21,20 +20,19 @@ public: return false; } }; -bool on_key_pressed(const KeyPressEvent & event){ - std::cout << "TestKeyListener: Key Pressed - Code: " << static_cast<int>(event.key) - << std::endl; - if(event.key == Keycode::ESCAPE){ - return true; - } - return false; +bool on_key_pressed(const KeyPressEvent & event) { + std::cout << "TestKeyListener: Key Pressed - Code: " << static_cast<int>(event.key) + << std::endl; + if (event.key == Keycode::ESCAPE) { + return true; } + return false; +} int main() { LoopManager gameloop; TestKeyListener key_listener; EventManager::get_instance().subscribe<KeyPressEvent>(on_key_pressed); gameloop.start(); - - + return 1; } |