diff options
| author | Miguel <m.i@gmx.at> | 2025-01-19 02:17:55 +0100 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2025-01-19 02:17:55 +0100 |
| commit | 2efa9f7028e90a60a569aa29b708897ae205740d (patch) | |
| tree | 0327b6d1986369f7f9c46afcd832dfcfcf6274f6 /main.cpp | |
| parent | aff0bc0d784c42f917822a126e0cbc583f5525dd (diff) | |
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |
