mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:00:05 +00:00
Add fonts to ImGui
This commit is contained in:
parent
7be3321d34
commit
5d9bf67fcc
4 changed files with 61 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ public:
|
|||
~ImGuiContextModelImpl() = default;
|
||||
|
||||
std::vector<ImGuiContextInfo> contexts_ {};
|
||||
ImFontAtlas fontAtlas_ {};
|
||||
};
|
||||
|
||||
ImGuiContextModel::ImGuiContextModel() :
|
||||
|
|
@ -86,7 +87,7 @@ ImGuiContext* ImGuiContextModel::CreateContext(const std::string& name)
|
|||
{
|
||||
static size_t nextId_ {0};
|
||||
|
||||
ImGuiContext* context = ImGui::CreateContext();
|
||||
ImGuiContext* context = ImGui::CreateContext(&p->fontAtlas_);
|
||||
ImGui::SetCurrentContext(context);
|
||||
|
||||
// ImGui Configuration
|
||||
|
|
@ -136,6 +137,11 @@ std::vector<ImGuiContextInfo> ImGuiContextModel::contexts() const
|
|||
return p->contexts_;
|
||||
}
|
||||
|
||||
ImFontAtlas* ImGuiContextModel::font_atlas()
|
||||
{
|
||||
return &p->fontAtlas_;
|
||||
}
|
||||
|
||||
ImGuiContextModel& ImGuiContextModel::Instance()
|
||||
{
|
||||
static ImGuiContextModel instance_ {};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <QAbstractListModel>
|
||||
|
||||
struct ImFontAtlas;
|
||||
struct ImGuiContext;
|
||||
|
||||
namespace scwx
|
||||
|
|
@ -46,6 +47,7 @@ public:
|
|||
void DestroyContext(const std::string& name);
|
||||
|
||||
std::vector<ImGuiContextInfo> contexts() const;
|
||||
ImFontAtlas* font_atlas();
|
||||
|
||||
static ImGuiContextModel& Instance();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue