aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-25 12:07:37 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-25 12:07:37 +0100
commit3d8251cd6b65a1e80002518ea48b1a74d91f6ab3 (patch)
tree7846a841411ea06abd60ed5d4d8612e0b75b36c6 /src
parentaaf1d8132b631b3c09672b27d6ca3141e875d71c (diff)
removed gameLoop example
Diffstat (limited to 'src')
-rw-r--r--src/example/CMakeLists.txt1
-rw-r--r--src/example/gameloop.cpp38
2 files changed, 0 insertions, 39 deletions
diff --git a/src/example/CMakeLists.txt b/src/example/CMakeLists.txt
index 560e2bc..85ec466 100644
--- a/src/example/CMakeLists.txt
+++ b/src/example/CMakeLists.txt
@@ -19,5 +19,4 @@ endfunction()
add_example(asset_manager)
add_example(savemgr)
add_example(rendering_particle)
-add_example(gameloop)
diff --git a/src/example/gameloop.cpp b/src/example/gameloop.cpp
deleted file mode 100644
index b8ee9d8..0000000
--- a/src/example/gameloop.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-#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) {
- }
- return false;
- }
- bool on_key_released(const KeyReleaseEvent & event) override {
- std::cout << "TestKeyListener: Key Released - Code: " << static_cast<int>(event.key)
- << std::endl;
- 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;
-}