summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2025-01-19 02:17:55 +0100
committerMiguel <m.i@gmx.at>2025-01-19 02:17:55 +0100
commit2efa9f7028e90a60a569aa29b708897ae205740d (patch)
tree0327b6d1986369f7f9c46afcd832dfcfcf6274f6 /main.cpp
parentaff0bc0d784c42f917822a126e0cbc583f5525dd (diff)
add fpsHEADmaster
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 2e01744..be82a90 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1011,9 +1011,21 @@ private:
void mainLoop() {
std::cout << "Enter Main Loop" << std::endl;
+ static int frames = 0;
while (!glfwWindowShouldClose(window) && !quit) {
glfwPollEvents();
drawFrame(); // 14 Drawing -> Rendering
+ frames++;
+
+
+ // Print the current time every second
+ double currentTime = glfwGetTime();
+ static double lastTime = 0.0;
+ if (currentTime - lastTime >= 1.0) {
+ std::cout << "Current Time: " << currentTime << " FPS: " << frames << std::endl;
+ frames = 0;
+ lastTime = currentTime;
+ }
}
vkDeviceWaitIdle(device);
std::cout << "Exit Main Loop" << std::endl;