Browse Source

imgui: use latest master branch.

legacy
Sam Hocevar 6 years ago
parent
commit
63bbcaad43
6 changed files with 19 additions and 12 deletions
  1. +1
    -1
      src/3rdparty/imgui
  2. +1
    -0
      src/3rdparty/lol-imgui.am
  3. +1
    -0
      src/Makefile.am
  4. +1
    -0
      src/lol-core.vcxproj
  5. +10
    -6
      src/lolimgui.cpp
  6. +5
    -5
      src/lolimgui.h

+ 1
- 1
src/3rdparty/imgui

@@ -1 +1 @@
Subproject commit 6742ac4587de26f9bec2a12cb0b2f33a4d84df94
Subproject commit 76e31bd51a4d045505a3f40d01cad734d7b2b4e0

+ 1
- 0
src/3rdparty/lol-imgui.am View File

@@ -2,6 +2,7 @@
imgui_sources = \ imgui_sources = \
imgui/imconfig.h \ imgui/imconfig.h \
imgui/imgui.cpp \ imgui/imgui.cpp \
imgui/imgui_widgets.cpp \
imgui/imgui.h \ imgui/imgui.h \
imgui/imgui_internal.h \ imgui/imgui_internal.h \
imgui/stb_rect_pack.h \ imgui/stb_rect_pack.h \


+ 1
- 0
src/Makefile.am View File

@@ -155,6 +155,7 @@ imgui_sources = \
lolimgui.cpp lolimgui.h \ lolimgui.cpp lolimgui.h \
3rdparty/imgui/imgui_demo.cpp \ 3rdparty/imgui/imgui_demo.cpp \
3rdparty/imgui/imgui_draw.cpp \ 3rdparty/imgui/imgui_draw.cpp \
3rdparty/imgui/imgui_widgets.cpp \
$(NULL) $(NULL)


if LOL_USE_NACL if LOL_USE_NACL


+ 1
- 0
src/lol-core.vcxproj View File

@@ -78,6 +78,7 @@
<ItemGroup> <ItemGroup>
<ClCompile Include="3rdparty\imgui\imgui_demo.cpp" /> <ClCompile Include="3rdparty\imgui\imgui_demo.cpp" />
<ClCompile Include="3rdparty\imgui\imgui_draw.cpp" /> <ClCompile Include="3rdparty\imgui\imgui_draw.cpp" />
<ClCompile Include="3rdparty\imgui\imgui_widgets.cpp" />
<ClCompile Include="application\application.cpp" /> <ClCompile Include="application\application.cpp" />
<ClCompile Include="audio\audio.cpp" /> <ClCompile Include="audio\audio.cpp" />
<ClCompile Include="audio\sample.cpp" /> <ClCompile Include="audio\sample.cpp" />


+ 10
- 6
src/lolimgui.cpp View File

@@ -27,11 +27,11 @@ using namespace lol;
//Imgui extension --------------------------------------------------------------------------------- //Imgui extension ---------------------------------------------------------------------------------
namespace ImGui 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); 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; vec4 pdg = padding;
vec2 vsz = vec2(Video::GetSize()); vec2 vsz = vec2(Video::GetSize());
@@ -55,11 +55,11 @@ namespace ImGui
ImGui::SetNextWindowSize(size, cond); 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); 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 vsz = vec2(Video::GetSize());
vec2 size = vec2(); vec2 size = vec2();
@@ -95,6 +95,8 @@ namespace ImGui
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LolImGui::LolImGui() LolImGui::LolImGui()
{ {
ImGui::CreateContext();

m_gamegroup = GAMEGROUP_IMGUI; m_gamegroup = GAMEGROUP_IMGUI;
m_drawgroup = DRAWGROUP_IMGUI; m_drawgroup = DRAWGROUP_IMGUI;


@@ -168,6 +170,8 @@ LolImGui::~LolImGui()


Shader::Destroy(m_shader); Shader::Destroy(m_shader);
delete m_vdecl; delete m_vdecl;

ImGui::DestroyContext();
} }


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -222,8 +226,6 @@ void LolImGui::Shutdown()
Ticker::Unref(g_lolimgui); Ticker::Unref(g_lolimgui);
g_lolimgui = nullptr; g_lolimgui = nullptr;
} }

ImGui::Shutdown();
} }


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -350,6 +352,7 @@ void LolImGui::TickDraw(float seconds, Scene &scene)


scene.AddPrimitiveRenderer(this, new PrimitiveLolImGui()); scene.AddPrimitiveRenderer(this, new PrimitiveLolImGui());
} }

void PrimitiveLolImGui::Render(Scene& scene, PrimitiveSource* primitive) void PrimitiveLolImGui::Render(Scene& scene, PrimitiveSource* primitive)
{ {
UNUSED(scene, primitive); UNUSED(scene, primitive);
@@ -357,6 +360,7 @@ void PrimitiveLolImGui::Render(Scene& scene, PrimitiveSource* primitive)
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
if (io.Fonts->TexID) if (io.Fonts->TexID)
ImGui::Render(); ImGui::Render();
ImGui::EndFrame();
} }


//// Data //// Data


+ 5
- 5
src/lolimgui.h View File

@@ -36,7 +36,7 @@
#undef IM_VEC4_CLASS_EXTRA #undef IM_VEC4_CLASS_EXTRA


//Imgui extension --------------------------------------------------------------------------------- //Imgui extension ---------------------------------------------------------------------------------
typedef int ImGuiSetDock; // condition flags for Set*() // enum ImGuiSetCond_
typedef int ImGuiSetDock; // condition flags for Set*() // enum ImGuiCond_


enum ImGuiSetDock_ enum ImGuiSetDock_
{ {
@@ -53,10 +53,10 @@ enum ImGuiSetDock_


namespace ImGui 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(); IMGUI_API float GetMainMenuBarHeight();
} }




Loading…
Cancel
Save