aboutsummaryrefslogtreecommitdiff
path: root/mwe/gameloop/include/loopManager.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-09-21 15:31:58 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-09-21 15:31:58 +0200
commitca393b6b47618e48c107ad5c021d86700343648e (patch)
tree298bff793ee331566b6be1840c8d7404409b5198 /mwe/gameloop/include/loopManager.h
parent8bf919f750807060f3ac2c640b8a02300af1733c (diff)
move gameloop poc to mwe
Diffstat (limited to 'mwe/gameloop/include/loopManager.h')
-rw-r--r--mwe/gameloop/include/loopManager.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/mwe/gameloop/include/loopManager.h b/mwe/gameloop/include/loopManager.h
new file mode 100644
index 0000000..06bcd5f
--- /dev/null
+++ b/mwe/gameloop/include/loopManager.h
@@ -0,0 +1,25 @@
+#pragma once
+#include <SDL2/SDL.h>
+#include "window.h"
+#include "gameObject.h"
+class LoopManager{
+ public:
+ LoopManager();
+ void setup();
+ void loop();
+ private:
+
+ std::vector<GameObject*> objectList;
+ void processInput();
+ void update();
+ void lateUpdate();
+ void fixedUpdate();
+ void render();
+ bool gameRunning = false;
+ WindowManager window;
+ int timeScale = 1;
+ float accumulator = 0.0;
+ double currentTime;
+ double t = 0.0;
+ double dt = 0.01;
+};