1
0
Fork 0

Debug: Support frame tracing via Tracy

Use CMake FetchContent to pull tracy sources and build it if frame tracing is enabled.
As frame tracing requires annotations in the code, create a wrapper that replaces them
with our own defines that are empty when tracing is not enabled.
This commit is contained in:
trotFunky 2024-02-05 13:55:27 +00:00
parent 8199fd3449
commit 7241ed7321
4 changed files with 50 additions and 0 deletions

View file

@ -5,6 +5,7 @@
#include <imgui.h>
#include <imgui-SFML.h>
#endif
#include "FrameTracing.h"
#include "World.h"
@ -37,8 +38,11 @@ int main()
sf::Clock frameTime;
while (window.isOpen())
{
FTrace_NamedScope("MainLoop");
while (window.pollEvent(event))
{
FTrace_NamedScope("EventLoop");
if (event.type == sf::Event::Closed) {
window.close();
continue;
@ -135,6 +139,7 @@ int main()
#endif
window.display();
FTrace_FrameMark;
}
#ifdef IMGUI