The tracy directory now has an experiment in getting Tracy to work. It's _not_ as easy as it is touted to be.

This commit is contained in:
Zed A. Shaw 2025-01-19 12:58:05 -05:00
parent 308fe4bed2
commit c98aa936ad
9 changed files with 400 additions and 7 deletions

View file

@ -26,8 +26,8 @@ void draw_gui(sf::RenderWindow &window, sf::Text &text, Stats &stats) {
window.draw(rect);
text.setString(
fmt::format("FPS\nmean:{:>8.5}\nsdev: {:>8.5}\nmin: {:>8.5}\nmax: {:>8.5}\ncount:{:<10}\n\nVSync? {}\nDebug? {}\n\nHit R to reset.",
stats.mean(), stats.stddev(), stats.min, stats.max, stats.n, VSYNC, DEBUG_BUILD));
fmt::format("FPS\nmean:{:>8.5}\nsdev: {:>8.5}\nmin: {:>8.5}\nmax: {:>8.5}\ncount:{:<10}\n\nVSync? {}\nFR Limit: {}\nDebug? {}\n\nHit R to reset.",
stats.mean(), stats.stddev(), stats.min, stats.max, stats.n, VSYNC, FRAME_LIMIT, DEBUG_BUILD));
window.draw(text);
}
@ -57,6 +57,7 @@ int main() {
Stats stats;
window.setVerticalSyncEnabled(VSYNC);
window.setFramerateLimit(FRAME_LIMIT);
while(window.isOpen()) {
@ -66,6 +67,7 @@ int main() {
auto elapsed = std::chrono::duration<double>(end - start);
stats.sample(1/elapsed.count());
draw_gui(window, text, stats);
window.display();