diff --git a/src/3rdparty/imgui b/src/3rdparty/imgui index 6742ac45..76e31bd5 160000 --- a/src/3rdparty/imgui +++ b/src/3rdparty/imgui @@ -1 +1 @@ -Subproject commit 6742ac4587de26f9bec2a12cb0b2f33a4d84df94 +Subproject commit 76e31bd51a4d045505a3f40d01cad734d7b2b4e0 diff --git a/src/3rdparty/lol-imgui.am b/src/3rdparty/lol-imgui.am index c03b6de9..478dfd0a 100644 --- a/src/3rdparty/lol-imgui.am +++ b/src/3rdparty/lol-imgui.am @@ -2,6 +2,7 @@ imgui_sources = \ imgui/imconfig.h \ imgui/imgui.cpp \ + imgui/imgui_widgets.cpp \ imgui/imgui.h \ imgui/imgui_internal.h \ imgui/stb_rect_pack.h \ diff --git a/src/Makefile.am b/src/Makefile.am index 6961be0e..402cb63f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -155,6 +155,7 @@ imgui_sources = \ lolimgui.cpp lolimgui.h \ 3rdparty/imgui/imgui_demo.cpp \ 3rdparty/imgui/imgui_draw.cpp \ + 3rdparty/imgui/imgui_widgets.cpp \ $(NULL) if LOL_USE_NACL diff --git a/src/lol-core.vcxproj b/src/lol-core.vcxproj index a336644e..2c9bd97d 100644 --- a/src/lol-core.vcxproj +++ b/src/lol-core.vcxproj @@ -78,6 +78,7 @@ + diff --git a/src/lolimgui.cpp b/src/lolimgui.cpp index 93e4d021..b4ae3d40 100644 --- a/src/lolimgui.cpp +++ b/src/lolimgui.cpp @@ -27,11 +27,11 @@ using namespace lol; //Imgui extension --------------------------------------------------------------------------------- namespace ImGui { - IMGUI_API void SetNextWindowDockingAndSize(const ImVec2& size, ImGuiSetDock dock, const ImVec2& padding, ImGuiSetCond cond) + IMGUI_API void SetNextWindowDockingAndSize(const ImVec2& size, ImGuiSetDock dock, const ImVec2& padding, ImGuiCond cond) { SetNextWindowDockingAndSize(size, dock, ImVec4(vec2(padding).xyxy), cond); } - IMGUI_API void SetNextWindowDockingAndSize(const ImVec2& size, ImGuiSetDock dock, const ImVec4& padding, ImGuiSetCond cond) + IMGUI_API void SetNextWindowDockingAndSize(const ImVec2& size, ImGuiSetDock dock, const ImVec4& padding, ImGuiCond cond) { vec4 pdg = padding; vec2 vsz = vec2(Video::GetSize()); @@ -55,11 +55,11 @@ namespace ImGui ImGui::SetNextWindowSize(size, cond); } - IMGUI_API void SetNextWindowDocking(ImGuiSetDock dock, const ImVec2& padding, ImGuiSetCond cond) + IMGUI_API void SetNextWindowDocking(ImGuiSetDock dock, const ImVec2& padding, ImGuiCond cond) { SetNextWindowDocking(dock, ImVec4(vec2(padding).xyxy), cond); } - IMGUI_API void SetNextWindowDocking(ImGuiSetDock dock, const ImVec4& padding, ImGuiSetCond cond) + IMGUI_API void SetNextWindowDocking(ImGuiSetDock dock, const ImVec4& padding, ImGuiCond cond) { vec2 vsz = vec2(Video::GetSize()); vec2 size = vec2(); @@ -95,6 +95,8 @@ namespace ImGui //----------------------------------------------------------------------------- LolImGui::LolImGui() { + ImGui::CreateContext(); + m_gamegroup = GAMEGROUP_IMGUI; m_drawgroup = DRAWGROUP_IMGUI; @@ -168,6 +170,8 @@ LolImGui::~LolImGui() Shader::Destroy(m_shader); delete m_vdecl; + + ImGui::DestroyContext(); } //----------------------------------------------------------------------------- @@ -222,8 +226,6 @@ void LolImGui::Shutdown() Ticker::Unref(g_lolimgui); g_lolimgui = nullptr; } - - ImGui::Shutdown(); } //----------------------------------------------------------------------------- @@ -350,6 +352,7 @@ void LolImGui::TickDraw(float seconds, Scene &scene) scene.AddPrimitiveRenderer(this, new PrimitiveLolImGui()); } + void PrimitiveLolImGui::Render(Scene& scene, PrimitiveSource* primitive) { UNUSED(scene, primitive); @@ -357,6 +360,7 @@ void PrimitiveLolImGui::Render(Scene& scene, PrimitiveSource* primitive) ImGuiIO& io = ImGui::GetIO(); if (io.Fonts->TexID) ImGui::Render(); + ImGui::EndFrame(); } //// Data diff --git a/src/lolimgui.h b/src/lolimgui.h index eb528f96..68ecb891 100644 --- a/src/lolimgui.h +++ b/src/lolimgui.h @@ -36,7 +36,7 @@ #undef IM_VEC4_CLASS_EXTRA //Imgui extension --------------------------------------------------------------------------------- -typedef int ImGuiSetDock; // condition flags for Set*() // enum ImGuiSetCond_ +typedef int ImGuiSetDock; // condition flags for Set*() // enum ImGuiCond_ enum ImGuiSetDock_ { @@ -53,10 +53,10 @@ enum ImGuiSetDock_ namespace ImGui { - IMGUI_API void SetNextWindowDockingAndSize(const ImVec2& size, ImGuiSetDock dock, const ImVec2& padding, ImGuiSetCond cond = 0); - IMGUI_API void SetNextWindowDockingAndSize(const ImVec2& size, ImGuiSetDock dock, const ImVec4& padding = ImVec4(0, 0, 0, 0), ImGuiSetCond cond = 0); - IMGUI_API void SetNextWindowDocking(ImGuiSetDock dock, const ImVec2& padding, ImGuiSetCond cond = 0); - IMGUI_API void SetNextWindowDocking(ImGuiSetDock dock, const ImVec4& padding = ImVec4(0, 0, 0, 0), ImGuiSetCond cond = 0); + IMGUI_API void SetNextWindowDockingAndSize(const ImVec2& size, ImGuiSetDock dock, const ImVec2& padding, ImGuiCond cond = 0); + IMGUI_API void SetNextWindowDockingAndSize(const ImVec2& size, ImGuiSetDock dock, const ImVec4& padding = ImVec4(0, 0, 0, 0), ImGuiCond cond = 0); + IMGUI_API void SetNextWindowDocking(ImGuiSetDock dock, const ImVec2& padding, ImGuiCond cond = 0); + IMGUI_API void SetNextWindowDocking(ImGuiSetDock dock, const ImVec4& padding = ImVec4(0, 0, 0, 0), ImGuiCond cond = 0); IMGUI_API float GetMainMenuBarHeight(); }