summaryrefslogtreecommitdiff
path: root/themes/MainLoop.cpp
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2022-12-23 12:47:10 -0500
committermattkae <mattkae@protonmail.com>2022-12-23 12:47:10 -0500
commit7228b2e1a2d0a8399facce3493d71a3569d250d5 (patch)
tree8eb5e4b686bf68fa12fcbb270ef88dd29aa1d704 /themes/MainLoop.cpp
parentf63d0af456f76d713e56ca17be114fba0af22f6c (diff)
Improved the makefile considerably
Diffstat (limited to 'themes/MainLoop.cpp')
-rw-r--r--themes/MainLoop.cpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/themes/MainLoop.cpp b/themes/MainLoop.cpp
deleted file mode 100644
index 09aa643..0000000
--- a/themes/MainLoop.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "MainLoop.h"
-#include <cstdio>
-#include <cstdlib>
-
-EM_BOOL loop(double time, void* loop) {
- MainLoop* mainLoop = (MainLoop*) loop;
- if (!mainLoop->isRunning) {
- return false;
- }
-
- if (mainLoop->lastTime == 0) {
- mainLoop->lastTime = time;
- return true;
- }
-
- long deltaTime = time - mainLoop->lastTime;
- mainLoop->lastTime = time;
- mainLoop->elapsedTime += deltaTime;
- mainLoop->numFrames++;
- float deltaTimeSeconds = static_cast<float>(deltaTime) / 1000.f;
-
- if (mainLoop->elapsedTime >= 1000.0) {
- printf("FPS: %d\n", mainLoop->numFrames);
-
- mainLoop->elapsedTime = 0.0;
- mainLoop->numFrames = 0;
- }
-
- mainLoop->updateFunc(deltaTimeSeconds, NULL);
- return true;
-} \ No newline at end of file