aboutsummaryrefslogtreecommitdiff
path: root/source/main.cpp
diff options
context:
space:
mode:
authorhnOsmium0001 <[email protected]>2022-04-25 22:17:42 -0700
committerhnOsmium0001 <[email protected]>2022-04-25 22:17:42 -0700
commita0b6646bbd601bfeaf0106cb4c22958c53085cac (patch)
treed806d5a9135feed65ca4d7ac0972e6e8fa109d28 /source/main.cpp
parente826894632f59c214c309d934843c49d73103612 (diff)
Add tracy
Diffstat (limited to 'source/main.cpp')
-rw-r--r--source/main.cpp14
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;
}
}