mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
fix: opengl resource delete error
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user