You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
project-kyoku/debughelper.h

48 lines
928 B
C++

#ifndef DEBUGHELPER_H
#define DEBUGHELPER_H
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/Text.hpp>
using microsec = sf::Int64;
class DebugHelper
{
public:
DebugHelper(bool init = true);
void toggle();
void update(const microsec& microseconds);
void drawOn(sf::RenderWindow &game_window) const;
void spawnGreenPulse();
void spawnRedPulse();
void spawnBluePulse();
private:
bool _toggled;
sf::Font _font;
sf::Text _time_print;
class Pulse
{
public:
Pulse(sf::Vector2f position, sf::Color fill_color);
void appear();
void fade();
void drawOn(sf::RenderWindow &game_window) const;
private:
sf::RectangleShape _pulse_shape;
};
Pulse _red_pulse;
Pulse _green_pulse;
Pulse _blue_pulse;
};
#endif // DEBUGHELPER_H