#include "Cubed/debug_collector.hpp" #include "Cubed/tools/system_info.hpp" #include "Cubed/tools/system_window_manager.hpp" #include "Cubed/ui/rect.hpp" #include "version.hpp" #include #include namespace Cubed { DebugCollector::DebugCollector() : m_widget(nullptr) {} DebugCollector& DebugCollector::get() { return *get_ptr(); } std::unique_ptr& DebugCollector::get_ptr() { static std::unique_ptr instance = std::make_unique(); return instance; } void DebugCollector::destory() { get_ptr().reset(); } void DebugCollector::init(int, int) { constexpr float SCALE = 0.7f; constexpr Color COLOR = Color::GRAY; constexpr float ALPHA = 0.6f; m_widget.set_spacing(15); m_widget.set_anchor(Anchor::TOP_LEFT); m_widget.set_offset({0, 5}); m_widget.set_child_anchor(ColumnLayoutAnchor::LEFT); auto add_label = [&](std::string_view text, std::string_view key = "") { auto& label = m_widget.add_child