40 lines
886 B
C++
40 lines
886 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
class RenderInfo {
|
|
public:
|
|
// Singleton
|
|
static void init();
|
|
static void destroy();
|
|
static auto get() -> RenderInfo*;
|
|
|
|
// Métodos principales
|
|
void update(float delta_time);
|
|
void render() const;
|
|
void toggle();
|
|
|
|
// Consultas
|
|
[[nodiscard]] auto isActive() const -> bool { return status_ != Status::HIDDEN; }
|
|
|
|
// Altura fija del overlay (TEXT_SIZE(6) + PADDING_V(2) * 2)
|
|
static constexpr int HEIGHT = 10;
|
|
static constexpr float SLIDE_SPEED = 120.0F;
|
|
|
|
private:
|
|
enum class Status : std::uint8_t { HIDDEN,
|
|
RISING,
|
|
ACTIVE,
|
|
VANISHING };
|
|
|
|
// Singleton
|
|
static RenderInfo* render_info;
|
|
|
|
// Constructor y destructor privados [SINGLETON]
|
|
RenderInfo();
|
|
~RenderInfo() = default;
|
|
|
|
Status status_{Status::HIDDEN};
|
|
float y_{static_cast<float>(-HEIGHT)};
|
|
};
|