feat: DebugOverlay for rendering debug information

This commit is contained in:
Florian Sylvain
2025-05-11 02:22:11 +02:00
parent 9b65954776
commit e493cf4b58
6 changed files with 73 additions and 4 deletions
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Text.hpp>
#include <SFML/System/Clock.hpp>
#include <string>
class DebugOverlay {
public:
DebugOverlay(const std::string& fontPath);
void update(int drawCalls, float timescale, const sf::RenderWindow& window);
void draw(sf::RenderWindow& window);
private:
sf::Font m_font;
sf::Text m_text;
sf::Clock m_fpsClock;
float m_fps = 0.f;
};