summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
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;