aboutsummaryrefslogtreecommitdiff
path: root/source/main.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-04-25 22:17:42 -0700
committerrtk0c <[email protected]>2022-04-25 22:17:42 -0700
commit6d228097491868136092a9cc9dc4df8ffd20dbd8 (patch)
tree46b2f7027a979ada44fa5c6fd3dfedb22d7e8d87 /source/main.cpp
parent7fa7840be1093f194031d2d5d9b45ada8613e72e (diff)
Changeset: 18 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;
}
}