renderd7/include/renderd7/Overlays.hpp
tobid7 5636205002 Changes:
Remove MEMTRACK Flag
Replace Draw2 with Render2
Rename sound and font to uppercase
Add SMART_CTOR to Image Sprite Sound
Port Everything to R2
2024-06-08 21:00:40 +02:00

103 lines
2.8 KiB
C++

/**
* This file is part of RenderD7
* Copyright (C) 2021-2024 NPI-D7, tobid7
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <renderd7/Ovl.hpp>
#include <string>
typedef int RD7Keyboard;
enum RD7Keyboard_ {
RD7Keyboard_Default,
RD7Keyboard_Numpad,
RD7Keyboard_Password,
};
enum RD7KeyboardState {
RD7KeyboardState_None = 0,
RD7KeyboardState_Cancel = 1,
RD7KeyboardState_Confirm = 2,
};
namespace RenderD7 {
class Ovl_Ftrace : public RenderD7::Ovl {
public:
/// @brief Constructor
Ovl_Ftrace(bool* is_enabled);
/// @brief Override for Draw
void Draw(void) const override;
/// @brief Override for Logic
void Logic() override;
private:
bool* i_is_enabled;
};
class Ovl_Metrik : public RenderD7::Ovl {
public:
/// @brief Constructor
Ovl_Metrik(bool* is_enabled, bool* screen, uint32_t* mt_color,
uint32_t* txt_color, float* txt_size);
/// @brief Override for Draw
void Draw(void) const override;
/// @brief Override for Logic
void Logic() override;
private:
// Mutable internal values
mutable std::string mt_fps;
mutable std::string mt_cpu;
mutable std::string mt_gpu;
mutable std::string mt_cmd;
mutable std::string mt_lfr;
mutable std::string mt_tbs;
mutable std::string mt_mem;
// Importand Adresses
bool* i_is_enabled;
bool* i_screen;
uint32_t* i_mt_color;
uint32_t* i_txt_color;
float* i_txt_size;
};
class Ovl_Keyboard : public RenderD7::Ovl {
public:
/// @brief Constructor
/// Keyboard Type not Supported for now
Ovl_Keyboard(std::string& ref, RD7KeyboardState& state,
const std::string& hint = "", RD7Keyboard type = 0);
/// @brief Deconstructor
~Ovl_Keyboard();
/// @brief Override for Draw
void Draw(void) const override;
/// @brief Override for Logic
void Logic() override;
private:
mutable std::map<unsigned char, char> shared_data;
// Pointer to useres String
std::string* typed_text = nullptr;
std::string str_bak;
RD7KeyboardState* state;
RD7Keyboard type;
int mode = 0;
int ft3 = 0;
};
} // namespace RenderD7