fix: opengl resource delete error

This commit is contained in:
2026-07-17 15:18:06 +08:00
parent 199735609f
commit 7244534ac4
5 changed files with 27 additions and 6 deletions

View File

@@ -5,6 +5,7 @@
#include "Cubed/ui/widget.hpp"
#include <format>
#include <memory>
#include <unordered_map>
namespace Cubed {
@@ -12,6 +13,7 @@ namespace Cubed {
class DebugCollector {
public:
static DebugCollector& get();
static void distory();
DebugCollector();
void report(const std::string& name, std::string_view content);
@@ -22,6 +24,7 @@ public:
private:
ColumnLayout m_widget;
std::unordered_map<std::string, Label*> m_component;
static std::unique_ptr<DebugCollector>& get_ptr();
};
template <typename... Args>

View File

@@ -51,6 +51,8 @@ public:
Font();
~Font();
static Font& get();
static void destroy();
TextMesh vertices(const std::string& text);
const Texture* text_texture();
static const std::string& font_path();
@@ -70,6 +72,7 @@ private:
int m_max_layers = 0;
Glyph& load_glyph(uint32_t glyph_index);
void upload_glyph(Glyph& glyph, const unsigned char* buffer);
static std::unique_ptr<Font>& get_ptr();
};
} // namespace Cubed