diff options
Diffstat (limited to 'source/main.cpp')
-rw-r--r-- | source/main.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/main.cpp b/source/main.cpp index 99a11c0..fe50b94 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -20,6 +20,9 @@ #include <filesystem> #include <string> +#include <tracy/Tracy.hpp> +#include <tracy/TracyClient.cpp> + namespace fs = std::filesystem; using namespace std::literals; @@ -379,7 +382,10 @@ void main() { double prevTime = glfwGetTime(); double accumulatedTime = 0.0; while (!glfwWindowShouldClose(window)) { - glfwPollEvents(); + { + ZoneScopedN("GameInput"); + glfwPollEvents(); + } double currTime = glfwGetTime(); double deltaTime = prevTime - currTime; @@ -392,6 +398,7 @@ void main() { while (accumulatedTime >= kSecondsPerUpdate) { double beg = glfwGetTime(); { + ZoneScopedN("GameUpdate"); app.Update(); } double end = glfwGetTime(); @@ -416,10 +423,12 @@ void main() { glClear(GL_COLOR_BUFFER_BIT); { // Regular draw + ZoneScopedN("Render"); app.Draw(currTime, deltaTime); } { // ImGui draw + ZoneScopedN("ImGui"); if (imguiUseOpenGL3) { ImGui_ImplOpenGL3_NewFrame(); } else { @@ -439,6 +448,9 @@ void main() { } glfwSwapBuffers(window); + FrameMark; + + prevTime = currTime; } } |