Renderer: Use imgui for drawing debug text and OSD

This commit is contained in:
Stenzek
2018-10-10 01:26:31 +11:00
parent d1868d9475
commit 600d1fc0bc
13 changed files with 268 additions and 324 deletions

View File

@ -11,15 +11,6 @@
namespace OSD
{
struct Message
{
Message() {}
Message(const std::string& s, u32 ts, u32 rgba) : m_str(s), m_timestamp(ts), m_rgba(rgba) {}
std::string m_str;
u32 m_timestamp;
u32 m_rgba;
};
enum class MessageType
{
NetPlayPing,
@ -49,20 +40,7 @@ constexpr u32 VERY_LONG = 10000;
void AddMessage(const std::string& message, u32 ms = Duration::SHORT, u32 rgba = Color::YELLOW);
void AddTypedMessage(MessageType type, const std::string& message, u32 ms = Duration::SHORT,
u32 rgba = Color::YELLOW);
void DrawMessage(const Message& msg, int top, int left, int time_left); // draw one message
void DrawMessages(); // draw the current messages on the screen. Only call once
// per frame.
void ClearMessages();
// On-screen callbacks
enum class CallbackType
{
Initialization,
OnFrame,
Shutdown
};
using Callback = std::function<void()>;
void AddCallback(CallbackType type, Callback cb);
void DoCallbacks(CallbackType type);
} // namespace OSD