diff --git a/src/modules/CharacterModule.cc b/src/modules/CharacterModule.cc index fe2302d..e42845d 100644 --- a/src/modules/CharacterModule.cc +++ b/src/modules/CharacterModule.cc @@ -11,6 +11,7 @@ #include "RuntimeModule.h" #include "Globals.h" #include "modules/RenderModule.h" +#include "imgui_dock.h" #include "Serializer.h" #include "Timer.h" @@ -45,6 +46,7 @@ const float cCharacterHeight = 1.8f; const float cCharacterWidth = 1.f; const char* cRigModelFile = "data/models/model.lua"; const char* cAnimFile = "data/models/anim.csv"; +static bool sCharacterDock = true; static VectorNf sRigQ; Quaternion offset_quat; @@ -567,7 +569,7 @@ void ShowCharacterPropertiesWindow (CharacterEntity* character) { ImGui::SetNextWindowSize (ImVec2(600.f, 300.0f), ImGuiSetCond_Once); ImGui::SetNextWindowPos (ImVec2(400.f, 16.0f), ImGuiSetCond_Once); -// if(ImGui::BeginDock("Character")) { + if (ImGui::BeginDock("Character", &sCharacterDock)) { if (ImGui::Button ("Reset")) { character->Reset(); @@ -673,10 +675,9 @@ void ShowCharacterPropertiesWindow (CharacterEntity* character) { } ImGui::TreePop(); } -// } + } - -// ImGui::EndDock(); + ImGui::EndDock(); } static struct module_state *module_init() { diff --git a/src/modules/RenderModule.cc b/src/modules/RenderModule.cc index 6cd72d3..93ed61f 100644 --- a/src/modules/RenderModule.cc +++ b/src/modules/RenderModule.cc @@ -45,9 +45,9 @@ typedef Vector3f Vector3f; typedef MatrixNNf MatrixNNf; typedef VectorNf VectorNf; -static bool show_scene0 = true; -static bool show_scene1 = true; -static bool show_scene2 = true; +static bool sDockInfoDock = true; +static bool sSceneDock = true; +static bool sRenderDock = true; struct Renderer; @@ -1710,7 +1710,7 @@ void Renderer::paintGL() { } } -// if (ImGui::BeginDock("Render Settings")) { + if (ImGui::BeginDock("Render Settings"), &sRenderDock) { if(ImGui::DragFloat3 ("Light0 Pos", lights[0].pos.data(), 1.0f, -10.0f, 10.0f)) { } @@ -1741,9 +1741,9 @@ void Renderer::paintGL() { 0.10f ); } -// } + } -// ImGui::EndDock(); + ImGui::EndDock(); // Advance to next frame. Rendering thread will be kicked to // process submitted rendering primitives. @@ -1772,12 +1772,12 @@ void Renderer::DrawGui() { ImGui::End(); } - if (ImGui::BeginDock("Docks", &show_scene0)) { + if (ImGui::BeginDock("Dock Info", &sDockInfoDock)) { ImGui::Print(); } ImGui::EndDock(); - if (ImGui::BeginDock("Scene", &show_scene1)) { + if (ImGui::BeginDock("Scene", &sSceneDock)) { ImVec2 size = ImGui::GetContentRegionAvail(); ImVec2 pos = ImGui::GetWindowPos();