mirror of
https://github.com/Floriansylvain/SFMLplayground.git
synced 2026-08-19 11:43:24 +02:00
feat: DebugOverlay for rendering debug information
This commit is contained in:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user