瀏覽代碼

imgui: allow to create a context with a custom font atlas.

legacy
Sam Hocevar 6 年之前
父節點
當前提交
92eca4f8ff
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. +4
    -4
      src/lolimgui.cpp
  2. +2
    -2
      src/lolimgui.h

+ 4
- 4
src/lolimgui.cpp 查看文件

@@ -28,9 +28,9 @@ static LolImGui* g_lolimgui = nullptr;
#define Line(s) ((s) + "\n")

//-----------------------------------------------------------------------------
LolImGui::LolImGui()
LolImGui::LolImGui(ImFontAtlas *shared_font_atlas)
{
ImGui::CreateContext();
ImGui::CreateContext(shared_font_atlas);

m_gamegroup = GAMEGROUP_IMGUI;
m_drawgroup = DRAWGROUP_IMGUI;
@@ -113,9 +113,9 @@ LolImGui::~LolImGui()
}

//-----------------------------------------------------------------------------
void LolImGui::Init()
void LolImGui::Init(ImFontAtlas *shared_font_atlas)
{
Ticker::Ref(g_lolimgui = new LolImGui());
Ticker::Ref(g_lolimgui = new LolImGui(shared_font_atlas));

ImGuiIO& io = ImGui::GetIO();
//ImFont* font0 = io.Fonts->AddFontDefault();


+ 2
- 2
src/lolimgui.h 查看文件

@@ -149,12 +149,12 @@ class LolImGui : public Entity

public:
//-------------------------------------------------------------------------
LolImGui();
LolImGui(ImFontAtlas *shared_font_atlas);
~LolImGui();
std::string GetName() const { return "<LolImGui>"; }

//-------------------------------------------------------------------------
static void Init();
static void Init(ImFontAtlas *shared_font_atlas = nullptr);
static void Shutdown();

//-------------------------------------------------------------------------


Loading…
取消
儲存