Browse Source

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

legacy
Sam Hocevar 6 years ago
parent
commit
92eca4f8ff
2 changed files with 6 additions and 6 deletions
  1. +4
    -4
      src/lolimgui.cpp
  2. +2
    -2
      src/lolimgui.h

+ 4
- 4
src/lolimgui.cpp View File

@@ -28,9 +28,9 @@ static LolImGui* g_lolimgui = nullptr;
#define Line(s) ((s) + "\n") #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_gamegroup = GAMEGROUP_IMGUI;
m_drawgroup = DRAWGROUP_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(); ImGuiIO& io = ImGui::GetIO();
//ImFont* font0 = io.Fonts->AddFontDefault(); //ImFont* font0 = io.Fonts->AddFontDefault();


+ 2
- 2
src/lolimgui.h View File

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


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


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


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


Loading…
Cancel
Save