Some debug infos
This commit is contained in:
parent
ed206fb71d
commit
cb5d96c669
16
Engine/Graphics/DebugUI.cpp
Normal file
16
Engine/Graphics/DebugUI.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include "DebugUI.hpp"
|
||||||
|
#include "../Misc/Fonts.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
DebugUI::DebugUI() {
|
||||||
|
gDbgFont.loadFromMemory(&_afont_monofonto_rg, FONTSIZE_MONOFONTO_RG);
|
||||||
|
gDbgText.setFont(gDbgFont);
|
||||||
|
gDbgText.setCharacterSize(14);
|
||||||
|
gDbgText.setPosition(0, 0);
|
||||||
|
gDbgText.setFillColor(sf::Color::White);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebugUI::UpdateDebugData(std::shared_ptr<sf::RenderWindow> context) {
|
||||||
|
gDbgText.setString("CPU Usage: XXX.X % (ticks: XXXX.X ms)\nFPS: XXX\nRAM Usage: XXXX.X MB");
|
||||||
|
context->draw(gDbgText);
|
||||||
|
}
|
21
Engine/Graphics/DebugUI.hpp
Normal file
21
Engine/Graphics/DebugUI.hpp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <SFML/Graphics/Font.hpp>
|
||||||
|
#include <SFML/Graphics/Text.hpp>
|
||||||
|
#include <SFML/Graphics/RenderWindow.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
class DebugUI {
|
||||||
|
public:
|
||||||
|
DebugUI();
|
||||||
|
~DebugUI() {}
|
||||||
|
|
||||||
|
void UpdateDebugData(std::shared_ptr<sf::RenderWindow> context);
|
||||||
|
|
||||||
|
private:
|
||||||
|
sf::Font gDbgFont;
|
||||||
|
sf::Text gDbgText;
|
||||||
|
|
||||||
|
};
|
1439
Engine/Misc/Fonts.hpp
Normal file
1439
Engine/Misc/Fonts.hpp
Normal file
File diff suppressed because it is too large
Load Diff
2
Game.cpp
2
Game.cpp
@ -55,6 +55,6 @@ GAME_STATUS Game::Update() {
|
|||||||
|
|
||||||
void Game::Render() {
|
void Game::Render() {
|
||||||
gMainWindow->clear();
|
gMainWindow->clear();
|
||||||
//gDbgUI->UpdateDebugData(gMainWindow);
|
gDbgUI->UpdateDebugData(gMainWindow);
|
||||||
gMainWindow->display();
|
gMainWindow->display();
|
||||||
}
|
}
|
@ -12,6 +12,7 @@ set(MISC_SCRS
|
|||||||
Engine/Misc/Console.hpp
|
Engine/Misc/Console.hpp
|
||||||
Engine/Misc/Logger.cpp
|
Engine/Misc/Logger.cpp
|
||||||
Engine/Misc/Logger.hpp
|
Engine/Misc/Logger.hpp
|
||||||
|
Engine/Misc/Fonts.hpp
|
||||||
)
|
)
|
||||||
set(GAME_SCRS
|
set(GAME_SCRS
|
||||||
Engine/World/Arena.cpp
|
Engine/World/Arena.cpp
|
||||||
@ -22,6 +23,8 @@ set(GRAPHS_SCRS
|
|||||||
Engine/Graphics/3DGraphics.cpp
|
Engine/Graphics/3DGraphics.cpp
|
||||||
Engine/Graphics/Camera.cpp
|
Engine/Graphics/Camera.cpp
|
||||||
Engine/Graphics/UI.cpp
|
Engine/Graphics/UI.cpp
|
||||||
|
Engine/Graphics/DebugUI.cpp
|
||||||
|
Engine/Graphics/DebugUI.hpp
|
||||||
)
|
)
|
||||||
set(SOUNDS_SCRS
|
set(SOUNDS_SCRS
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user