From 5e11d7c0de81723a7ce30c6165d1448cd775dde3 Mon Sep 17 00:00:00 2001 From: aiekick Date: Thu, 1 Aug 2024 13:46:05 +0200 Subject: [PATCH] [FIX] : fix compilation --- 3rdparty/BuildInc/CMakeLists.txt | 2 +- VERSION | 2 +- cmake/libs/gaia.cmake | 2 +- cmake/libs/lumobackend.cmake | 2 +- libs/Gaia | 2 +- .../include/LumoBackend/Base/BaseRenderer.h | 2 +- .../include/LumoBackend/Base/ShaderPass.h | 2 +- .../include/LumoBackend/Graph/Base/BaseNode.h | 2 +- .../LumoBackend/Headers/LumoBackendBuild.h | 4 +- .../LumoBackend/Interfaces/GuiInterface.h | 3 +- .../LumoBackend/Interfaces/NodeInterface.h | 1 + .../LumoBackend/Interfaces/PluginInterface.h | 6 ++- .../include/LumoBackend/Systems/SceneMerger.h | 2 +- libs/LumoBackend/src/Base/BaseRenderer.cpp | 4 +- libs/LumoBackend/src/Base/ShaderPass.cpp | 4 +- libs/LumoBackend/src/Graph/Base/BaseNode.cpp | 28 +++++++------ .../LumoBackend/src/SceneGraph/SceneLight.cpp | 7 ++-- libs/LumoBackend/src/Systems/SceneMerger.cpp | 2 +- src/Backend/MainBackend.cpp | 12 +++--- src/Backend/MainBackend.h | 10 ++++- src/Frontend/MainFrontend.cpp | 40 +++++++++---------- src/Frontend/MainFrontend.h | 2 +- src/Graph/Manager/NodeManager.cpp | 4 +- src/Graph/Manager/NodeManager.h | 2 +- .../Modules/Assets/Load/CubeMapModule.cpp | 10 ++--- src/Graph/Modules/Assets/Load/CubeMapModule.h | 4 +- src/Graph/Modules/Assets/Load/MeshModule.cpp | 4 +- src/Graph/Modules/Assets/Load/MeshModule.h | 2 +- .../Modules/Assets/Load/Texture2DModule.cpp | 8 ++-- .../Modules/Assets/Load/Texture2DModule.h | 4 +- .../Assets/Save/ModelExporterModule.cpp | 4 +- .../Modules/Assets/Save/ModelExporterModule.h | 2 +- .../Assets/Save/TextureExporterModule.cpp | 2 +- .../Assets/Save/TextureExporterModule.h | 2 +- src/Graph/Modules/Misc/GridModule.cpp | 2 +- src/Graph/Modules/Misc/GridModule.h | 2 +- .../Misc/Pass/GridModule_Vertex_Pass.cpp | 2 +- .../Misc/Pass/GridModule_Vertex_Pass.h | 2 +- src/Graph/Modules/Misc/SceneMergerModule.cpp | 2 +- src/Graph/Modules/Misc/SceneMergerModule.h | 2 +- .../Modules/Renderers/MatcapRenderer.cpp | 2 +- src/Graph/Modules/Renderers/MatcapRenderer.h | 2 +- .../Modules/Renderers/ModelRendererModule.cpp | 4 +- .../Modules/Renderers/ModelRendererModule.h | 2 +- .../Pass/MatcapRenderer_Mesh_Pass.cpp | 2 +- .../Renderers/Pass/MatcapRenderer_Mesh_Pass.h | 2 +- .../Pass/ModelRendererModule_Mesh_Pass.cpp | 2 +- .../Pass/ModelRendererModule_Mesh_Pass.h | 2 +- src/Graph/Modules/Utils/MathModule.cpp | 2 +- src/Graph/Modules/Utils/MathModule.h | 2 +- src/Graph/Modules/Utils/MeshBuffersModule.cpp | 2 +- src/Graph/Modules/Utils/MeshBuffersModule.h | 2 +- .../Utils/Pass/MathModule_Quad_Pass.cpp | 2 +- .../Modules/Utils/Pass/MathModule_Quad_Pass.h | 2 +- .../Pass/MeshBuffersModule_Mesh_Pass.cpp | 2 +- .../Utils/Pass/MeshBuffersModule_Mesh_Pass.h | 2 +- .../Widgets/Pass/WidgetColorModule_Pass.cpp | 2 +- .../Widgets/Pass/WidgetColorModule_Pass.h | 2 +- src/Graph/Modules/Widgets/VariableModule.cpp | 2 +- src/Graph/Modules/Widgets/VariableModule.h | 2 +- .../Modules/Widgets/WidgetColorModule.cpp | 2 +- src/Graph/Modules/Widgets/WidgetColorModule.h | 2 +- src/Graph/Nodes/Assets/Load/CubeMapNode.cpp | 4 +- src/Graph/Nodes/Assets/Load/CubeMapNode.h | 2 +- src/Graph/Nodes/Assets/Load/MeshNode.cpp | 4 +- src/Graph/Nodes/Assets/Load/MeshNode.h | 2 +- src/Graph/Nodes/Assets/Load/Texture2DNode.cpp | 4 +- src/Graph/Nodes/Assets/Load/Texture2DNode.h | 2 +- .../Nodes/Assets/Save/ModelExporterNode.cpp | 4 +- .../Nodes/Assets/Save/ModelExporterNode.h | 2 +- .../Nodes/Assets/Save/TextureExporterNode.cpp | 4 +- .../Nodes/Assets/Save/TextureExporterNode.h | 2 +- src/Graph/Nodes/Misc/GridNode.cpp | 2 +- src/Graph/Nodes/Misc/GridNode.h | 2 +- src/Graph/Nodes/Misc/SceneMergerNode.cpp | 4 +- src/Graph/Nodes/Misc/SceneMergerNode.h | 2 +- .../Nodes/Renderers/MatcapRendererNode.cpp | 4 +- .../Nodes/Renderers/MatcapRendererNode.h | 2 +- .../Nodes/Renderers/ModelRendererNode.cpp | 4 +- src/Graph/Nodes/Renderers/ModelRendererNode.h | 2 +- src/Graph/Nodes/Utils/MathNode.cpp | 4 +- src/Graph/Nodes/Utils/MathNode.h | 2 +- src/Graph/Nodes/Utils/MeshBuffersNode.cpp | 4 +- src/Graph/Nodes/Utils/MeshBuffersNode.h | 2 +- src/Graph/Nodes/Widgets/VariableNode.cpp | 4 +- src/Graph/Nodes/Widgets/VariableNode.h | 2 +- src/Graph/Nodes/Widgets/WidgetColorNode.cpp | 4 +- src/Graph/Nodes/Widgets/WidgetColorNode.h | 2 +- src/Headers/LumoBuild.h | 4 +- src/Panes/AnimatePane.cpp | 10 ++--- src/Panes/AnimatePane.h | 4 +- src/Panes/ConsolePane.cpp | 10 ++--- src/Panes/ConsolePane.h | 4 +- src/Panes/DebugPane.cpp | 8 ++-- src/Panes/DebugPane.h | 4 +- src/Panes/GraphPane.cpp | 20 +++++----- src/Panes/GraphPane.h | 6 +-- src/Panes/ProfilerPane.cpp | 13 +++--- src/Panes/ProfilerPane.h | 7 +--- src/Panes/SceneTreePane.cpp | 8 ++-- src/Panes/SceneTreePane.h | 5 +-- src/Panes/SceneViewPane.cpp | 18 +++++---- src/Panes/SceneViewPane.h | 5 +-- src/Panes/TuningPane.cpp | 8 ++-- src/Panes/TuningPane.h | 5 +-- src/Panes/View2DPane.cpp | 16 ++++---- src/Panes/View2DPane.h | 5 +-- src/Panes/View3DPane.cpp | 20 +++++----- src/Panes/View3DPane.h | 5 +-- src/Scene/Manager/SceneManager.cpp | 4 +- src/Scene/Manager/SceneManager.h | 2 +- 111 files changed, 259 insertions(+), 255 deletions(-) diff --git a/3rdparty/BuildInc/CMakeLists.txt b/3rdparty/BuildInc/CMakeLists.txt index 0aecd8692..b2d4f8cda 100644 --- a/3rdparty/BuildInc/CMakeLists.txt +++ b/3rdparty/BuildInc/CMakeLists.txt @@ -5,4 +5,4 @@ enable_language(C) project(${PROJECT} C) add_executable(${PROJECT} BuildInc.c) -set_target_properties(${PROJECT} PROPERTIES FOLDER 3rdpartyTools) +set_target_properties(${PROJECT} PROPERTIES FOLDER 3rdparty/Tools) diff --git a/VERSION b/VERSION index 3babadb41..3093873f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Lumo_Windows_Debug_x64_v0.0.5571 +Lumo_Windows_Debug_x64_v0.0.5587 diff --git a/cmake/libs/gaia.cmake b/cmake/libs/gaia.cmake index 5baef1396..676d5f0af 100644 --- a/cmake/libs/gaia.cmake +++ b/cmake/libs/gaia.cmake @@ -10,7 +10,7 @@ set(USE_MSVC_RUNTIME_LIBRARY_DLL ON CACHE BOOL "") add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs/Gaia) -set_target_properties(Gaia PROPERTIES FOLDER Libs/Shared) +set_target_properties(Gaia PROPERTIES FOLDER 3rdparty/Shared/aiekick) set_target_properties(Gaia PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${FINAL_BIN_DIR}") set_target_properties(Gaia PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}") diff --git a/cmake/libs/lumobackend.cmake b/cmake/libs/lumobackend.cmake index 5a2d8c70b..a7bce3fd8 100644 --- a/cmake/libs/lumobackend.cmake +++ b/cmake/libs/lumobackend.cmake @@ -11,7 +11,7 @@ set(USE_MSVC_RUNTIME_LIBRARY_DLL ON CACHE BOOL "") add_subdirectory(${CMAKE_SOURCE_DIR}/libs/LumoBackend) -set_target_properties(LumoBackend PROPERTIES FOLDER Libs/Shared) +set_target_properties(LumoBackend PROPERTIES FOLDER 3rdparty/Shared/aiekick) set_target_properties(LumoBackend PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${FINAL_BIN_DIR}") set_target_properties(LumoBackend PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}") diff --git a/libs/Gaia b/libs/Gaia index 6f5dfb0b0..70ae92539 160000 --- a/libs/Gaia +++ b/libs/Gaia @@ -1 +1 @@ -Subproject commit 6f5dfb0b0a5fb4bfabfd065ef6a5480445a0ab20 +Subproject commit 70ae92539bf79ea2bc15e5ed9c91a24f8a084c79 diff --git a/libs/LumoBackend/include/LumoBackend/Base/BaseRenderer.h b/libs/LumoBackend/include/LumoBackend/Base/BaseRenderer.h index d381d3ebf..934bcfb6a 100644 --- a/libs/LumoBackend/include/LumoBackend/Base/BaseRenderer.h +++ b/libs/LumoBackend/include/LumoBackend/Base/BaseRenderer.h @@ -169,7 +169,7 @@ class LUMO_BACKEND_API BaseRenderer : public conf::ConfigAbstract, public GuiInt bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; virtual void ResetFrame(); diff --git a/libs/LumoBackend/include/LumoBackend/Base/ShaderPass.h b/libs/LumoBackend/include/LumoBackend/Base/ShaderPass.h index a6ab39da0..0d2791f1a 100644 --- a/libs/LumoBackend/include/LumoBackend/Base/ShaderPass.h +++ b/libs/LumoBackend/include/LumoBackend/Base/ShaderPass.h @@ -243,7 +243,7 @@ class LUMO_BACKEND_API ShaderPass : public conf::ConfigAbstract, public ShaderUp bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void SetFrameBuffer(FrameBufferWeak vFrameBufferWeak); diff --git a/libs/LumoBackend/include/LumoBackend/Graph/Base/BaseNode.h b/libs/LumoBackend/include/LumoBackend/Graph/Base/BaseNode.h index 54acaa697..c31ec9e62 100644 --- a/libs/LumoBackend/include/LumoBackend/Graph/Base/BaseNode.h +++ b/libs/LumoBackend/include/LumoBackend/Graph/Base/BaseNode.h @@ -570,7 +570,7 @@ class LUMO_BACKEND_API BaseNode : public conf::ConfigAbstract, public: // gui interface bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr, void* vUserDatas) override; bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr, void* vUserDatas) override; - bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) override; + bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) override; public: // pane virtual bool DrawDebugInfos(BaseNodeState* vBaseNodeState); diff --git a/libs/LumoBackend/include/LumoBackend/Headers/LumoBackendBuild.h b/libs/LumoBackend/include/LumoBackend/Headers/LumoBackendBuild.h index 010631e7c..7d33c84c5 100644 --- a/libs/LumoBackend/include/LumoBackend/Headers/LumoBackendBuild.h +++ b/libs/LumoBackend/include/LumoBackend/Headers/LumoBackendBuild.h @@ -1,7 +1,7 @@ #pragma once #define LumoBackend_Prefix "LumoBackend" -#define LumoBackend_BuildNumber 717 +#define LumoBackend_BuildNumber 729 #define LumoBackend_MinorNumber 2 #define LumoBackend_MajorNumber 0 -#define LumoBackend_BuildId "0.2.717" +#define LumoBackend_BuildId "0.2.729" diff --git a/libs/LumoBackend/include/LumoBackend/Interfaces/GuiInterface.h b/libs/LumoBackend/include/LumoBackend/Interfaces/GuiInterface.h index f6c68891e..24504fc22 100644 --- a/libs/LumoBackend/include/LumoBackend/Interfaces/GuiInterface.h +++ b/libs/LumoBackend/include/LumoBackend/Interfaces/GuiInterface.h @@ -29,6 +29,5 @@ class LUMO_BACKEND_API GuiInterface { public: virtual bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr, void* vUserDatas) = 0; virtual bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr, void* vUserDatas) = 0; - virtual bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) = 0; + virtual bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) = 0; }; \ No newline at end of file diff --git a/libs/LumoBackend/include/LumoBackend/Interfaces/NodeInterface.h b/libs/LumoBackend/include/LumoBackend/Interfaces/NodeInterface.h index 76ff58f01..b443abfed 100644 --- a/libs/LumoBackend/include/LumoBackend/Interfaces/NodeInterface.h +++ b/libs/LumoBackend/include/LumoBackend/Interfaces/NodeInterface.h @@ -21,6 +21,7 @@ limitations under the License. #include #include #include +#include class LUMO_BACKEND_API NodeInterface { protected: diff --git a/libs/LumoBackend/include/LumoBackend/Interfaces/PluginInterface.h b/libs/LumoBackend/include/LumoBackend/Interfaces/PluginInterface.h index 8c77fb805..be911d4ac 100644 --- a/libs/LumoBackend/include/LumoBackend/Interfaces/PluginInterface.h +++ b/libs/LumoBackend/include/LumoBackend/Interfaces/PluginInterface.h @@ -23,7 +23,6 @@ limitations under the License. #include #include -#include #include #include @@ -83,7 +82,8 @@ class LUMO_BACKEND_API PluginPaneConfig { AbstractPaneWeak paneWeak; std::string paneName; std::string paneCategory; - PaneDisposal paneDisposal = PaneDisposal::CENTRAL; + float paneRatio = 0.0f; + PaneDisposal paneDisposal = "CENTRAL"; bool isPaneOpenedDefault = false; bool isPaneFocusedDefault = false; @@ -92,11 +92,13 @@ class LUMO_BACKEND_API PluginPaneConfig { std::string vName, std::string vPaneCategory, PaneDisposal vPaneDisposal, + float vPaneRatio, bool vIsOpenedDefault, bool vIsFocusedDefault) : paneWeak(vPaneWeak), paneName(vName), paneCategory(vPaneCategory), + paneRatio(vPaneRatio), paneDisposal(vPaneDisposal), isPaneOpenedDefault(vIsOpenedDefault), isPaneFocusedDefault(vIsFocusedDefault) { diff --git a/libs/LumoBackend/include/LumoBackend/Systems/SceneMerger.h b/libs/LumoBackend/include/LumoBackend/Systems/SceneMerger.h index 84ca095a1..e09c5d028 100644 --- a/libs/LumoBackend/include/LumoBackend/Systems/SceneMerger.h +++ b/libs/LumoBackend/include/LumoBackend/Systems/SceneMerger.h @@ -59,7 +59,7 @@ class LUMO_BACKEND_API SceneMerger : public BaseRenderer, // bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; - bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; void NeedResizeByHand(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; diff --git a/libs/LumoBackend/src/Base/BaseRenderer.cpp b/libs/LumoBackend/src/Base/BaseRenderer.cpp index 19b775594..7527b6aa1 100644 --- a/libs/LumoBackend/src/Base/BaseRenderer.cpp +++ b/libs/LumoBackend/src/Base/BaseRenderer.cpp @@ -391,7 +391,7 @@ bool BaseRenderer::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRe } bool BaseRenderer::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); @@ -399,7 +399,7 @@ bool BaseRenderer::DrawDialogsAndPopups( for (auto pass : m_ShaderPasses) { auto pass_ptr = pass.lock(); if (pass_ptr) { - change |= pass_ptr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + change |= pass_ptr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } } return change; diff --git a/libs/LumoBackend/src/Base/ShaderPass.cpp b/libs/LumoBackend/src/Base/ShaderPass.cpp index 5920815ab..dc7b72b75 100644 --- a/libs/LumoBackend/src/Base/ShaderPass.cpp +++ b/libs/LumoBackend/src/Base/ShaderPass.cpp @@ -512,10 +512,10 @@ bool ShaderPass::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect } bool ShaderPass::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; UNUSED(vCurrentFrame); - UNUSED(vMaxSize); + UNUSED(vMaxRect); assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); diff --git a/libs/LumoBackend/src/Graph/Base/BaseNode.cpp b/libs/LumoBackend/src/Graph/Base/BaseNode.cpp index d2dd3e536..8f6737406 100644 --- a/libs/LumoBackend/src/Graph/Base/BaseNode.cpp +++ b/libs/LumoBackend/src/Graph/Base/BaseNode.cpp @@ -973,15 +973,13 @@ bool BaseNode::DrawWidgets(const uint32_t& /*vCurrentFrame*/, ImGuiContext* vCon return false; } -bool BaseNode::DrawOverlays( - const uint32_t& /*vCurrentFrame*/, const ImRect& /*vRect*/, ImGuiContext* vContextPtr, void* /*vUserDatas*/) { +bool BaseNode::DrawOverlays(const uint32_t& /*vCurrentFrame*/, const ImRect& /*vRect*/, ImGuiContext* vContextPtr, void* /*vUserDatas*/) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); return false; } -bool BaseNode::DrawDialogsAndPopups( - const uint32_t& /*vCurrentFrame*/, const ImVec2& /*vMaxSize*/, ImGuiContext* vContextPtr, void* /*vUserDatas*/) { +bool BaseNode::DrawDialogsAndPopups(const uint32_t& /*vCurrentFrame*/, const ImRect& /*vMaxRect*/, ImGuiContext* vContextPtr, void* /*vUserDatas*/) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); return false; @@ -2247,6 +2245,14 @@ std::vector BaseNode::InjectTypeInSlot(NodeSlotWeak vSlotToSplit, //// CONFIGURATION /////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////// +static inline ct::fvec2 toFVec2(const ImVec2& v) { + return ct::fvec2(v.x, v.y); +} + +static inline ImVec2 toImVec2(const ct::fvec2& v) { + return ImVec2(v.x, v.y); +} + std::string BaseNode::getXml(const std::string& vOffset, const std::string& vUserDatas) { std::string res; @@ -2254,7 +2260,7 @@ std::string BaseNode::getXml(const std::string& vOffset, const std::string& vUse res += vOffset + "\n"; res += vOffset + "\t\n"; - res += vOffset + "\t\t" + ct::fvec2(GetCanvasOffset()).string() + "\n"; + res += vOffset + "\t\t" + toFVec2(GetCanvasOffset()).string() + "\n"; res += vOffset + "\t\t" + ct::toStr(GetCanvasScale()) + "\n"; res += vOffset + "\t\n"; @@ -2357,11 +2363,11 @@ bool BaseNode::setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vPa strParentName = vParent->Value(); if (strParentName == "canvas") { - if (strName == "offset") - SetCanvasOffset(ct::toImVec2(ct::fvariant(strValue).GetV2())); - else if (strName == "scale") + if (strName == "offset") { + SetCanvasOffset(toImVec2(ct::fvariant(strValue).GetV2())); + } else if (strName == "scale") { SetCanvasScale(ct::fvariant(strValue).GetF()); - + } return false; } else if (strParentName == "nodes") { if (strName == "node") { @@ -2369,11 +2375,9 @@ bool BaseNode::setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vPa std::string _type; ct::fvec2 _pos; uint32_t _nodeId = 0; - for (const tinyxml2::XMLAttribute* attr = vElem->FirstAttribute(); attr != nullptr; attr = attr->Next()) { std::string attName = attr->Name(); std::string attValue = attr->Value(); - if (attName == "name") _name = attValue; else if (attName == "type") @@ -2383,11 +2387,9 @@ bool BaseNode::setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vPa else if (attName == "id") _nodeId = ct::ivariant(attValue).GetU(); } - if (LoadNodeFromXML_Callback(m_This, vElem, vParent, _name, _type, _pos, _nodeId)) { RecursParsingConfigChilds(vElem, vUserDatas); } - return false; } } else if (strParentName == "links") { diff --git a/libs/LumoBackend/src/SceneGraph/SceneLight.cpp b/libs/LumoBackend/src/SceneGraph/SceneLight.cpp index 88ad4fbaa..0f3aa9817 100644 --- a/libs/LumoBackend/src/SceneGraph/SceneLight.cpp +++ b/libs/LumoBackend/src/SceneGraph/SceneLight.cpp @@ -19,6 +19,7 @@ limitations under the License. #include #include +#include SceneLightPtr SceneLight::Create() { auto res = std::make_shared(); @@ -95,10 +96,10 @@ bool SceneLight::NeedUpdateCamera() { } void SceneLight::AdaptIconColor() { - gizmo_idle_color = ct::toImVec4(lightDatas.lightColor); + gizmo_idle_color = ImVec4(lightDatas.lightColor.x, lightDatas.lightColor.y, lightDatas.lightColor.z, lightDatas.lightColor.w); gizmo_idle_color.w = 1.0f; - gizmo_hovered_color = ct::toImVec4(lightDatas.lightColor * 1.5f); + gizmo_hovered_color = gizmo_idle_color * 1.5f; gizmo_hovered_color.w = 1.0f; - gizmo_pressed_color = ct::toImVec4(lightDatas.lightColor * 2.0f); + gizmo_pressed_color = gizmo_idle_color * 2.0f; gizmo_pressed_color.w = 1.0f; } diff --git a/libs/LumoBackend/src/Systems/SceneMerger.cpp b/libs/LumoBackend/src/Systems/SceneMerger.cpp index e9aba51bb..db66f7c05 100644 --- a/libs/LumoBackend/src/Systems/SceneMerger.cpp +++ b/libs/LumoBackend/src/Systems/SceneMerger.cpp @@ -113,7 +113,7 @@ bool SceneMerger::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRec return false; } -bool SceneMerger::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { +bool SceneMerger::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Backend/MainBackend.cpp b/src/Backend/MainBackend.cpp index 8087d140d..8d8904883 100644 --- a/src/Backend/MainBackend.cpp +++ b/src/Backend/MainBackend.cpp @@ -336,7 +336,8 @@ void MainBackend::m_MainLoop() { m_Update(); // to do absolutly beofre imgui rendering - m_PrepareImGui(ct::ivec4(0, m_VulkanWindowPtr->getWindowResolution())); + const auto& reso = m_VulkanWindowPtr->getWindowResolution(); + m_PrepareImGui(ImRect(ImVec2(), ImVec2(reso.x, reso.y))); // Merged Rendering bool needResize = false; @@ -405,7 +406,7 @@ void MainBackend::m_EndRender() { m_VulkanCorePtr->Present(); } -void MainBackend::m_PrepareImGui(ct::ivec4 vViewport) { +void MainBackend::m_PrepareImGui(ImRect vViewport) { ZoneScoped; ImGui::SetPUSHID(125); @@ -415,8 +416,7 @@ void MainBackend::m_PrepareImGui(ct::ivec4 vViewport) { FrameMark; m_ImGuiOverlayPtr->getFrontend()->Display(m_CurrentFrame); - NodeManager::Instance()->DrawDialogsAndPopups( - m_CurrentFrame, ImVec2((float)vViewport.size().x, (float)vViewport.size().y), ImGui::GetCurrentContext(), {}); + NodeManager::Instance()->DrawDialogsAndPopups(m_CurrentFrame, vViewport, ImGui::GetCurrentContext(), {}); m_ImGuiOverlayPtr->end(); } @@ -746,7 +746,7 @@ void MainBackend::m_InitPlugins() { for (auto& pluginPane : pluginPanes) { if (!pluginPane.paneWeak.expired()) { LayoutManager::Instance()->AddPane(pluginPane.paneWeak, pluginPane.paneName, pluginPane.paneCategory, pluginPane.paneDisposal, - pluginPane.isPaneOpenedDefault, pluginPane.isPaneFocusedDefault); + pluginPane.paneRatio, pluginPane.isPaneOpenedDefault, pluginPane.isPaneFocusedDefault); auto plugin_ptr = std::dynamic_pointer_cast(pluginPane.paneWeak.lock()); if (plugin_ptr != nullptr) { plugin_ptr->SetProjectInstancePtr(ProjectFile::Instance()); @@ -772,7 +772,7 @@ void MainBackend::m_UnitSystems() { void MainBackend::m_InitPanes() { if (LayoutManager::Instance()->InitPanes()) { // a faire apres InitPanes() sinon ConsolePane::Instance()->paneFlag vaudra 0 et changeras apres InitPanes() - Messaging::Instance()->sMessagePaneId = ConsolePane::Instance()->paneFlag; + Messaging::Instance()->sMessagePaneId = ConsolePane::Instance()->GetFlag(); } } diff --git a/src/Backend/MainBackend.h b/src/Backend/MainBackend.h index 855d41505..ad259de8e 100644 --- a/src/Backend/MainBackend.h +++ b/src/Backend/MainBackend.h @@ -52,6 +52,7 @@ class MainBackend : public gaia::iService, public gaia::iSurface, pub std::vector> m_FileDialogAssets; + ct::ivec2 m_DisplayPos; ct::ivec2 m_DisplaySize; // mouse @@ -84,9 +85,16 @@ class MainBackend : public gaia::iService, public gaia::iSurface, pub BackendDatas& GetBackendDatasRef() { return m_BackendDatas; } + ImVec2 GetDisplayPos() { + return ImVec2((float)m_DisplayPos.x, (float)m_DisplayPos.y); + } ImVec2 GetDisplaySize() { return ImVec2((float)m_DisplaySize.x, (float)m_DisplaySize.y); } + ImRect GetDisplayRect() { + const auto& p = GetDisplayPos(); + return ImRect(p, p + GetDisplaySize()); + } public: virtual ~MainBackend(); @@ -183,7 +191,7 @@ class MainBackend : public gaia::iService, public gaia::iSurface, pub void m_MainLoop(); bool m_BeginRender(bool& vNeedResize); void m_EndRender(); - void m_PrepareImGui(ct::ivec4 vViewport); + void m_PrepareImGui(ImRect vViewport); void m_Update(); void m_IncFrame(); void m_Resize(); diff --git a/src/Frontend/MainFrontend.cpp b/src/Frontend/MainFrontend.cpp index fbf76da0c..845938a82 100644 --- a/src/Frontend/MainFrontend.cpp +++ b/src/Frontend/MainFrontend.cpp @@ -90,20 +90,16 @@ bool MainFrontend::init() { LayoutManager::Instance()->Init("Layouts", "Default Layout"); - LayoutManager::Instance()->SetPaneDisposalSize(PaneDisposal::LEFT, 300.0f); - LayoutManager::Instance()->SetPaneDisposalSize(PaneDisposal::RIGHT, 300.0f); - LayoutManager::Instance()->SetPaneDisposalSize(PaneDisposal::BOTTOM, 300.0f); - - LayoutManager::Instance()->AddPane(DebugPane::Instance(), "Debug Pane", "", PaneDisposal::CENTRAL, false, false); - LayoutManager::Instance()->AddPane(SceneTreePane::Instance(), "Scene Tree Pane", "", PaneDisposal::RIGHT, false, false); - LayoutManager::Instance()->AddPane(SceneViewPane::Instance(), "Scene View Pane", "", PaneDisposal::LEFT, true, true); - LayoutManager::Instance()->AddPane(GraphPane::Instance(), "Graph Pane", "", PaneDisposal::CENTRAL, true, false); - LayoutManager::Instance()->AddPane(TuningPane::Instance(), "Tuning Pane", "", PaneDisposal::RIGHT, true, false); - LayoutManager::Instance()->AddPane(View3DPane::Instance(), "View3D Pane", "", PaneDisposal::LEFT, true, true); - LayoutManager::Instance()->AddPane(View2DPane::Instance(), "View2D Pane", "", PaneDisposal::LEFT, false, false); - LayoutManager::Instance()->AddPane(ConsolePane::Instance(), "Console Pane", "", PaneDisposal::BOTTOM, false, false); - LayoutManager::Instance()->AddPane(ProfilerPane::Instance(), "Profiler Pane", "", PaneDisposal::BOTTOM, false, false); - // LayoutManager::Instance()->AddPane(AnimatePane::Instance(), "Animate Pane", "", PaneDisposal::BOTTOM, false, false); + LayoutManager::Instance()->AddPane(DebugPane::Instance(), "Debug Pane", "", "CENTRAL", 0.0f, false, false); + LayoutManager::Instance()->AddPane(SceneTreePane::Instance(), "Scene Tree Pane", "", "RIGHT", 0.3f, false, false); + LayoutManager::Instance()->AddPane(SceneViewPane::Instance(), "Scene View Pane", "", "LEFT", 0.3f, true, true); + LayoutManager::Instance()->AddPane(GraphPane::Instance(), "Graph Pane", "", "CENTRAL", 0.0f, true, false); + LayoutManager::Instance()->AddPane(TuningPane::Instance(), "Tuning Pane", "", "RIGHT", 0.3f, true, false); + LayoutManager::Instance()->AddPane(View3DPane::Instance(), "View3D Pane", "", "LEFT", 0.3f, true, true); + LayoutManager::Instance()->AddPane(View2DPane::Instance(), "View2D Pane", "", "LEFT", 0.3f, false, false); + LayoutManager::Instance()->AddPane(ConsolePane::Instance(), "Console Pane", "", "BOTTOM", 0.3f, false, false); + LayoutManager::Instance()->AddPane(ProfilerPane::Instance(), "Profiler Pane", "", "BOTTOM", 0.3f, false, false); + // LayoutManager::Instance()->AddPane(AnimatePane::Instance(), "Animate Pane", "", "BOTTOM", 0.3f, false, false); // InitPänes is done in m_InitPanes, because a specific order is needed @@ -158,7 +154,7 @@ void MainFrontend::Display(const uint32_t& vCurrentFrame) { ProjectFile::Instance()->SetProjectChange(); } - DrawDialogsAndPopups(vCurrentFrame, MainBackend::Instance()->GetDisplaySize(), context_ptr, {}); + DrawDialogsAndPopups(vCurrentFrame, MainBackend::Instance()->GetDisplayRect(), context_ptr, {}); ImGuiThemeHelper::Instance()->Draw(); LayoutManager::Instance()->InitAfterFirstDisplay(io.DisplaySize); @@ -198,9 +194,9 @@ bool MainFrontend::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRe } bool MainFrontend::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { m_ActionSystem.RunActions(); - LayoutManager::Instance()->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + LayoutManager::Instance()->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); if (m_ShowImGui) { ImGui::ShowDemoWindow(&m_ShowImGui); } @@ -359,15 +355,15 @@ void MainFrontend::m_drawLeftButtonBar() { if (ImGui::CoolBarItem()) { // Debug Pane const auto aw = ImGui::GetCoolBarItemWidth(); m_ToolbarFontPtr->Scale = font_scale_ratio * ImGui::GetCoolBarItemScale(); - ImGui::RadioButtonLabeled_BitWize(ImVec2(aw, aw), DEBUG_PANE_ICON "##Debug", nullptr, - &LayoutManager::Instance()->pane_Shown, DebugPane::Instance()->paneFlag, false, true, 0, false, m_ToolbarFontPtr); + ImGui::RadioButtonLabeled_BitWize(ImVec2(aw, aw), DEBUG_PANE_ICON "##Debug", nullptr, + &LayoutManager::Instance()->pane_Shown, DebugPane::Instance()->GetFlag(), false, true, 0, false, m_ToolbarFontPtr); } #endif // _DEBUG /*if (ImGui::CoolBarItem()) { // show/hide Scene Pane const auto aw = ImGui::GetCoolBarItemWidth(); m_ToolbarFontPtr->Scale = font_scale_ratio * ImGui::GetCoolBarItemScale(); - ImGui::RadioButtonLabeled_BitWize(ImVec2(aw, aw), + ImGui::RadioButtonLabeled_BitWize(ImVec2(aw, aw), SCENE_PANE_ICON "##Scene", nullptr, &LayoutManager::Instance()->pane_Shown, @@ -382,8 +378,8 @@ void MainFrontend::m_drawLeftButtonBar() { if (ImGui::CoolBarItem()) { // show/hide Tuning Pane const auto aw = ImGui::GetCoolBarItemWidth(); m_ToolbarFontPtr->Scale = font_scale_ratio * ImGui::GetCoolBarItemScale(); - ImGui::RadioButtonLabeled_BitWize(ImVec2(aw, aw), TUNING_PANE_ICON "##Tuning", nullptr, - &LayoutManager::Instance()->pane_Shown, TuningPane::Instance()->paneFlag, false, true, 0, false, m_ToolbarFontPtr); + ImGui::RadioButtonLabeled_BitWize(ImVec2(aw, aw), TUNING_PANE_ICON "##Tuning", nullptr, + &LayoutManager::Instance()->pane_Shown, TuningPane::Instance()->GetFlag(), false, true, 0, false, m_ToolbarFontPtr); } if (ImGui::CoolBarItem()) { // show/hide Grid Renderer diff --git a/src/Frontend/MainFrontend.h b/src/Frontend/MainFrontend.h index 61b47c9ad..31308bf4a 100644 --- a/src/Frontend/MainFrontend.h +++ b/src/Frontend/MainFrontend.h @@ -151,7 +151,7 @@ class MainFrontend : public gaia::iService, public gaia::iSurface, pu bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr, void* vUserDatas) override; bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr, void* vUserDatas) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) override; void OpenAboutDialog(); diff --git a/src/Graph/Manager/NodeManager.cpp b/src/Graph/Manager/NodeManager.cpp index 96ec15b81..bcf9a69b4 100644 --- a/src/Graph/Manager/NodeManager.cpp +++ b/src/Graph/Manager/NodeManager.cpp @@ -155,7 +155,7 @@ bool NodeManager::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRec } bool NodeManager::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); @@ -164,7 +164,7 @@ bool NodeManager::DrawDialogsAndPopups( for (auto eff : m_RootNodePtr->m_ChildNodes) { auto nodePtr = eff.second; if (nodePtr) { - change |= nodePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + change |= nodePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } } diff --git a/src/Graph/Manager/NodeManager.h b/src/Graph/Manager/NodeManager.h index 7606fabdf..2d0491dfb 100644 --- a/src/Graph/Manager/NodeManager.h +++ b/src/Graph/Manager/NodeManager.h @@ -44,7 +44,7 @@ class NodeManager : public GuiInterface, public conf::ConfigAbstract, public Tas bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr, void* vUserDatas) override; bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr, void* vUserDatas) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) override; void FinalizeGraphLoading(); diff --git a/src/Graph/Modules/Assets/Load/CubeMapModule.cpp b/src/Graph/Modules/Assets/Load/CubeMapModule.cpp index afde77747..3207811c0 100644 --- a/src/Graph/Modules/Assets/Load/CubeMapModule.cpp +++ b/src/Graph/Modules/Assets/Load/CubeMapModule.cpp @@ -142,13 +142,13 @@ bool CubeMapModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vR } bool CubeMapModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); - ImVec2 max = ImVec2((float)vMaxSize.x, (float)vMaxSize.y); + ImVec2 max = vMaxRect.GetSize(); ImVec2 min = max * 0.5f; if (ImGuiFileDialog::Instance()->Display(unique_OpenPictureFileDialog_id, ImGuiWindowFlags_NoCollapse, min, max)) { @@ -258,7 +258,7 @@ void CubeMapModule::ClearTextures() { } } -void CubeMapModule::DrawTextures(const ct::ivec2& vMaxSize, const float& vRounding) { +void CubeMapModule::DrawTextures(const ct::ivec2& vMaxRect, const float& vRounding) { if (m_TextureCubePtr) { ImGuiWindow* window = ImGui::GetCurrentWindow(); if (window->SkipItems) @@ -274,9 +274,9 @@ void CubeMapModule::DrawTextures(const ct::ivec2& vMaxSize, const float& vRoundi static int32_t roundedCorners[3U][4U] = {{0, ImDrawFlags_RoundCornersTop, 0, 0}, {ImDrawFlags_RoundCornersLeft, 0, 0, ImDrawFlags_RoundCornersRight}, {0, ImDrawFlags_RoundCornersBottom, 0, 0}}; - const ImVec2 size = ImVec2((float)vMaxSize.x / 4.0f, (float)vMaxSize.y / 3.0f); + const ImVec2 size = ImVec2((float)vMaxRect.x / 4.0f, (float)vMaxRect.y / 3.0f); const ImVec2 spos = window->DC.CursorPos; - const ImRect bb(spos, spos + ImVec2((float)vMaxSize.x, (float)vMaxSize.y)); + const ImRect bb(spos, spos + ImVec2((float)vMaxRect.x, (float)vMaxRect.y)); ImGui::ItemSize(bb); if (!ImGui::ItemAdd(bb, 0)) return; diff --git a/src/Graph/Modules/Assets/Load/CubeMapModule.h b/src/Graph/Modules/Assets/Load/CubeMapModule.h index 914d14127..d2cf8d1d5 100644 --- a/src/Graph/Modules/Assets/Load/CubeMapModule.h +++ b/src/Graph/Modules/Assets/Load/CubeMapModule.h @@ -58,7 +58,7 @@ class CubeMapModule : public conf::ConfigAbstract, public NodeInterface, public bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // Interfaces Getters vk::DescriptorImageInfo* GetTextureCube(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr) override; @@ -66,7 +66,7 @@ class CubeMapModule : public conf::ConfigAbstract, public NodeInterface, public std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; bool setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vParent, const std::string& vUserDatas = "") override; - void DrawTextures(const ct::ivec2& vMaxSize, const float& vRounding = 0.0f); + void DrawTextures(const ct::ivec2& vMaxRect, const float& vRounding = 0.0f); private: void LoadTextures(const std::string& vFilePathName); diff --git a/src/Graph/Modules/Assets/Load/MeshModule.cpp b/src/Graph/Modules/Assets/Load/MeshModule.cpp index 813870aea..cf5ba7319 100644 --- a/src/Graph/Modules/Assets/Load/MeshModule.cpp +++ b/src/Graph/Modules/Assets/Load/MeshModule.cpp @@ -143,11 +143,11 @@ bool MeshModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect } bool MeshModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); - ImVec2 max = ImVec2((float)vMaxSize.x, (float)vMaxSize.y); + ImVec2 max = vMaxRect.GetSize(); ImVec2 min = max * 0.5f; if (ImGuiFileDialog::Instance()->Display(unique_OpenMeshFileDialog_id, ImGuiWindowFlags_NoCollapse, min, max)) { diff --git a/src/Graph/Modules/Assets/Load/MeshModule.h b/src/Graph/Modules/Assets/Load/MeshModule.h index f8b1fa5a2..b98f6c91b 100644 --- a/src/Graph/Modules/Assets/Load/MeshModule.h +++ b/src/Graph/Modules/Assets/Load/MeshModule.h @@ -66,7 +66,7 @@ class MeshModule : public conf::ConfigAbstract, public NodeInterface, public Mod bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; SceneModelWeak GetModel() override; private: diff --git a/src/Graph/Modules/Assets/Load/Texture2DModule.cpp b/src/Graph/Modules/Assets/Load/Texture2DModule.cpp index 034e37c70..8b85ed503 100644 --- a/src/Graph/Modules/Assets/Load/Texture2DModule.cpp +++ b/src/Graph/Modules/Assets/Load/Texture2DModule.cpp @@ -116,11 +116,11 @@ bool Texture2DModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& } bool Texture2DModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); - ImVec2 max = ImVec2((float)vMaxSize.x, (float)vMaxSize.y); + ImVec2 max = vMaxRect.GetSize(); ImVec2 min = max * 0.5f; if (ImGuiFileDialog::Instance()->Display(unique_OpenPictureFileDialog_id, ImGuiWindowFlags_NoCollapse, min, max)) { @@ -137,9 +137,9 @@ bool Texture2DModule::DrawDialogsAndPopups( return false; } -void Texture2DModule::DrawTexture(ct::ivec2 vMaxSize) { +void Texture2DModule::DrawTexture(ct::ivec2 vMaxRect) { if (m_ImGuiTexture.canDisplayPreview) { - auto rect = ct::GetScreenRectWithRatio(m_ImGuiTexture.ratio, vMaxSize, false); + auto rect = ct::GetScreenRectWithRatio(m_ImGuiTexture.ratio, vMaxRect, false); const ImVec2 pos = ImVec2((float)rect.x, (float)rect.y); const ImVec2 siz = ImVec2((float)rect.w, (float)rect.h); diff --git a/src/Graph/Modules/Assets/Load/Texture2DModule.h b/src/Graph/Modules/Assets/Load/Texture2DModule.h index 768808ce4..2e48a52e2 100644 --- a/src/Graph/Modules/Assets/Load/Texture2DModule.h +++ b/src/Graph/Modules/Assets/Load/Texture2DModule.h @@ -59,9 +59,9 @@ class Texture2DModule : public conf::ConfigAbstract, public GuiInterface, public bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; - void DrawTexture(ct::ivec2 vMaxSize); + void DrawTexture(ct::ivec2 vMaxRect); vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; diff --git a/src/Graph/Modules/Assets/Save/ModelExporterModule.cpp b/src/Graph/Modules/Assets/Save/ModelExporterModule.cpp index 5228bb3de..50fe70a8e 100644 --- a/src/Graph/Modules/Assets/Save/ModelExporterModule.cpp +++ b/src/Graph/Modules/Assets/Save/ModelExporterModule.cpp @@ -197,11 +197,11 @@ bool ModelExporterModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRe } bool ModelExporterModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); - ImVec2 max = ImVec2((float)vMaxSize.x, (float)vMaxSize.y); + ImVec2 max = vMaxRect.GetSize(); ImVec2 min = max * 0.5f; // manual save file if (ImGuiFileDialog::Instance()->Display(unique_SaveMeshFileDialog_id, ImGuiWindowFlags_NoCollapse, min, max)) { diff --git a/src/Graph/Modules/Assets/Save/ModelExporterModule.h b/src/Graph/Modules/Assets/Save/ModelExporterModule.h index a7f41dd2e..7929f2087 100644 --- a/src/Graph/Modules/Assets/Save/ModelExporterModule.h +++ b/src/Graph/Modules/Assets/Save/ModelExporterModule.h @@ -100,7 +100,7 @@ class ModelExporterModule : public NodeInterface, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // Interfaces Setters void SetModel(SceneModelWeak vSceneModel) override; diff --git a/src/Graph/Modules/Assets/Save/TextureExporterModule.cpp b/src/Graph/Modules/Assets/Save/TextureExporterModule.cpp index 4563ee7b2..3e7a1d756 100644 --- a/src/Graph/Modules/Assets/Save/TextureExporterModule.cpp +++ b/src/Graph/Modules/Assets/Save/TextureExporterModule.cpp @@ -114,7 +114,7 @@ bool TextureExporterModule::DrawOverlays( } bool TextureExporterModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); diff --git a/src/Graph/Modules/Assets/Save/TextureExporterModule.h b/src/Graph/Modules/Assets/Save/TextureExporterModule.h index 5ed65b30d..3169af137 100644 --- a/src/Graph/Modules/Assets/Save/TextureExporterModule.h +++ b/src/Graph/Modules/Assets/Save/TextureExporterModule.h @@ -64,7 +64,7 @@ class TextureExporterModule : public NodeInterface, public conf::ConfigAbstract, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // Interfaces Setters void SetTexture(const uint32_t& vBindingPoint, vk::DescriptorImageInfo* vImageInfo, ct::fvec2* vTextureSize, void* vUserDatas = nullptr) override; diff --git a/src/Graph/Modules/Misc/GridModule.cpp b/src/Graph/Modules/Misc/GridModule.cpp index 5cd96a1a9..f833ee030 100644 --- a/src/Graph/Modules/Misc/GridModule.cpp +++ b/src/Graph/Modules/Misc/GridModule.cpp @@ -130,7 +130,7 @@ bool GridModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect } bool GridModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Misc/GridModule.h b/src/Graph/Modules/Misc/GridModule.h index 6d02f34f9..f92dc43d4 100644 --- a/src/Graph/Modules/Misc/GridModule.h +++ b/src/Graph/Modules/Misc/GridModule.h @@ -47,7 +47,7 @@ class GridModule : public TaskRenderer, public Texture2DOutputInterface, public bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; SceneShaderPassWeak GetShaderPasses(const uint32_t& vSlotID) override; diff --git a/src/Graph/Modules/Misc/Pass/GridModule_Vertex_Pass.cpp b/src/Graph/Modules/Misc/Pass/GridModule_Vertex_Pass.cpp index b005f4007..71d50d68c 100644 --- a/src/Graph/Modules/Misc/Pass/GridModule_Vertex_Pass.cpp +++ b/src/Graph/Modules/Misc/Pass/GridModule_Vertex_Pass.cpp @@ -92,7 +92,7 @@ bool GridModule_Vertex_Pass::DrawOverlays( } bool GridModule_Vertex_Pass::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); return false; diff --git a/src/Graph/Modules/Misc/Pass/GridModule_Vertex_Pass.h b/src/Graph/Modules/Misc/Pass/GridModule_Vertex_Pass.h index 356e40558..98f78931f 100644 --- a/src/Graph/Modules/Misc/Pass/GridModule_Vertex_Pass.h +++ b/src/Graph/Modules/Misc/Pass/GridModule_Vertex_Pass.h @@ -50,7 +50,7 @@ class GridModule_Vertex_Pass : public VertexShaderPass, public Texture2DOutputIn bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; private: diff --git a/src/Graph/Modules/Misc/SceneMergerModule.cpp b/src/Graph/Modules/Misc/SceneMergerModule.cpp index 79d6b24aa..b18fd98e0 100644 --- a/src/Graph/Modules/Misc/SceneMergerModule.cpp +++ b/src/Graph/Modules/Misc/SceneMergerModule.cpp @@ -170,7 +170,7 @@ bool SceneMergerModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect } bool SceneMergerModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); diff --git a/src/Graph/Modules/Misc/SceneMergerModule.h b/src/Graph/Modules/Misc/SceneMergerModule.h index 3a7ec8169..3560b240c 100644 --- a/src/Graph/Modules/Misc/SceneMergerModule.h +++ b/src/Graph/Modules/Misc/SceneMergerModule.h @@ -77,7 +77,7 @@ class SceneMergerModule : public NodeInterface, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; void NeedResizeByHand(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; diff --git a/src/Graph/Modules/Renderers/MatcapRenderer.cpp b/src/Graph/Modules/Renderers/MatcapRenderer.cpp index a7f5696b2..d8c3a716e 100644 --- a/src/Graph/Modules/Renderers/MatcapRenderer.cpp +++ b/src/Graph/Modules/Renderers/MatcapRenderer.cpp @@ -134,7 +134,7 @@ bool MatcapRenderer::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& v } bool MatcapRenderer::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Renderers/MatcapRenderer.h b/src/Graph/Modules/Renderers/MatcapRenderer.h index ea3cac83a..f92559eb1 100644 --- a/src/Graph/Modules/Renderers/MatcapRenderer.h +++ b/src/Graph/Modules/Renderers/MatcapRenderer.h @@ -60,7 +60,7 @@ class MatcapRenderer : public TaskRenderer, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers = nullptr) override; void SetModel(SceneModelWeak vSceneModel = SceneModelWeak()) override; void SetTexture(const uint32_t& vBindingPoint, vk::DescriptorImageInfo* vImageInfo, ct::fvec2* vTextureSize, void* vUserDatas = nullptr) override; diff --git a/src/Graph/Modules/Renderers/ModelRendererModule.cpp b/src/Graph/Modules/Renderers/ModelRendererModule.cpp index b88cfb7f4..879050cec 100644 --- a/src/Graph/Modules/Renderers/ModelRendererModule.cpp +++ b/src/Graph/Modules/Renderers/ModelRendererModule.cpp @@ -161,7 +161,7 @@ bool ModelRendererModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRe return false; } -bool ModelRendererModule::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) +bool ModelRendererModule::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; @@ -170,7 +170,7 @@ bool ModelRendererModule::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, co if (m_LastExecutedFrame == vCurrentFrame) { if (m_ModelRendererModule_Mesh_Pass_Ptr) { - return m_ModelRendererModule_Mesh_Pass_Ptr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_ModelRendererModule_Mesh_Pass_Ptr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } } diff --git a/src/Graph/Modules/Renderers/ModelRendererModule.h b/src/Graph/Modules/Renderers/ModelRendererModule.h index a465ac6b0..19bebee37 100644 --- a/src/Graph/Modules/Renderers/ModelRendererModule.h +++ b/src/Graph/Modules/Renderers/ModelRendererModule.h @@ -80,7 +80,7 @@ class ModelRendererModule : bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; - bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; diff --git a/src/Graph/Modules/Renderers/Pass/MatcapRenderer_Mesh_Pass.cpp b/src/Graph/Modules/Renderers/Pass/MatcapRenderer_Mesh_Pass.cpp index b702c1db7..9e8ced9c8 100644 --- a/src/Graph/Modules/Renderers/Pass/MatcapRenderer_Mesh_Pass.cpp +++ b/src/Graph/Modules/Renderers/Pass/MatcapRenderer_Mesh_Pass.cpp @@ -115,7 +115,7 @@ bool MatcapRenderer_Mesh_Pass::DrawOverlays( } bool MatcapRenderer_Mesh_Pass::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Renderers/Pass/MatcapRenderer_Mesh_Pass.h b/src/Graph/Modules/Renderers/Pass/MatcapRenderer_Mesh_Pass.h index ed1f9a656..bd416e661 100644 --- a/src/Graph/Modules/Renderers/Pass/MatcapRenderer_Mesh_Pass.h +++ b/src/Graph/Modules/Renderers/Pass/MatcapRenderer_Mesh_Pass.h @@ -62,7 +62,7 @@ class MatcapRenderer_Mesh_Pass : public ShaderPass, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void SetModel(SceneModelWeak vSceneModel = SceneModelWeak()) override; void SetTexture(const uint32_t& vBindingPoint, vk::DescriptorImageInfo* vImageInfo, ct::fvec2* vTextureSize, void* vUserDatas = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; diff --git a/src/Graph/Modules/Renderers/Pass/ModelRendererModule_Mesh_Pass.cpp b/src/Graph/Modules/Renderers/Pass/ModelRendererModule_Mesh_Pass.cpp index 53bd85522..239786e92 100644 --- a/src/Graph/Modules/Renderers/Pass/ModelRendererModule_Mesh_Pass.cpp +++ b/src/Graph/Modules/Renderers/Pass/ModelRendererModule_Mesh_Pass.cpp @@ -142,7 +142,7 @@ bool ModelRendererModule_Mesh_Pass::DrawOverlays(const uint32_t& vCurrentFrame, return false; } -bool ModelRendererModule_Mesh_Pass::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { +bool ModelRendererModule_Mesh_Pass::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Renderers/Pass/ModelRendererModule_Mesh_Pass.h b/src/Graph/Modules/Renderers/Pass/ModelRendererModule_Mesh_Pass.h index cdd061d2e..3b1f9d4e1 100644 --- a/src/Graph/Modules/Renderers/Pass/ModelRendererModule_Mesh_Pass.h +++ b/src/Graph/Modules/Renderers/Pass/ModelRendererModule_Mesh_Pass.h @@ -104,7 +104,7 @@ class ModelRendererModule_Mesh_Pass : void DrawModel(vk::CommandBuffer * vCmdBufferPtr, const int& vIterationNumber) override; bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; - bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // Interfaces Setters void SetModel(SceneModelWeak vSceneModel) override; diff --git a/src/Graph/Modules/Utils/MathModule.cpp b/src/Graph/Modules/Utils/MathModule.cpp index 424d3b6ae..dbd055c3d 100644 --- a/src/Graph/Modules/Utils/MathModule.cpp +++ b/src/Graph/Modules/Utils/MathModule.cpp @@ -140,7 +140,7 @@ bool MathModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect } bool MathModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Utils/MathModule.h b/src/Graph/Modules/Utils/MathModule.h index 3d5c56ecf..10c302db0 100644 --- a/src/Graph/Modules/Utils/MathModule.h +++ b/src/Graph/Modules/Utils/MathModule.h @@ -69,7 +69,7 @@ class MathModule : public BaseRenderer, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void SetTexture(const uint32_t& vBindingPoint, vk::DescriptorImageInfo* vImageInfo, ct::fvec2* vTextureSize, void* vUserDatas = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Graph/Modules/Utils/MeshBuffersModule.cpp b/src/Graph/Modules/Utils/MeshBuffersModule.cpp index 4bbe9b917..aa6702462 100644 --- a/src/Graph/Modules/Utils/MeshBuffersModule.cpp +++ b/src/Graph/Modules/Utils/MeshBuffersModule.cpp @@ -129,7 +129,7 @@ bool MeshBuffersModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect } bool MeshBuffersModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Utils/MeshBuffersModule.h b/src/Graph/Modules/Utils/MeshBuffersModule.h index cd1a38a11..c21f5db7d 100644 --- a/src/Graph/Modules/Utils/MeshBuffersModule.h +++ b/src/Graph/Modules/Utils/MeshBuffersModule.h @@ -64,7 +64,7 @@ class MeshBuffersModule : public BaseRenderer, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers = nullptr) override; void SetModel(SceneModelWeak vSceneModel = SceneModelWeak()) override; void SetTexture(const uint32_t& vBindingPoint, vk::DescriptorImageInfo* vImageInfo, ct::fvec2* vTextureSize, void* vUserDatas = nullptr) override; diff --git a/src/Graph/Modules/Utils/Pass/MathModule_Quad_Pass.cpp b/src/Graph/Modules/Utils/Pass/MathModule_Quad_Pass.cpp index 083763fde..1b7418ac4 100644 --- a/src/Graph/Modules/Utils/Pass/MathModule_Quad_Pass.cpp +++ b/src/Graph/Modules/Utils/Pass/MathModule_Quad_Pass.cpp @@ -153,7 +153,7 @@ bool MathModule_Quad_Pass::DrawOverlays( } bool MathModule_Quad_Pass::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Utils/Pass/MathModule_Quad_Pass.h b/src/Graph/Modules/Utils/Pass/MathModule_Quad_Pass.h index 17003f5ba..b289fb07a 100644 --- a/src/Graph/Modules/Utils/Pass/MathModule_Quad_Pass.h +++ b/src/Graph/Modules/Utils/Pass/MathModule_Quad_Pass.h @@ -71,7 +71,7 @@ class MathModule_Quad_Pass : public QuadShaderPass, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void SetTexture(const uint32_t& vBindingPoint, vk::DescriptorImageInfo* vImageInfo, ct::fvec2* vTextureSize, void* vUserDatas = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas) override; diff --git a/src/Graph/Modules/Utils/Pass/MeshBuffersModule_Mesh_Pass.cpp b/src/Graph/Modules/Utils/Pass/MeshBuffersModule_Mesh_Pass.cpp index 80de6d83e..7710f2a95 100644 --- a/src/Graph/Modules/Utils/Pass/MeshBuffersModule_Mesh_Pass.cpp +++ b/src/Graph/Modules/Utils/Pass/MeshBuffersModule_Mesh_Pass.cpp @@ -78,7 +78,7 @@ bool MeshBuffersModule_Mesh_Pass::DrawOverlays( } bool MeshBuffersModule_Mesh_Pass::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Utils/Pass/MeshBuffersModule_Mesh_Pass.h b/src/Graph/Modules/Utils/Pass/MeshBuffersModule_Mesh_Pass.h index f408081b8..596f78819 100644 --- a/src/Graph/Modules/Utils/Pass/MeshBuffersModule_Mesh_Pass.h +++ b/src/Graph/Modules/Utils/Pass/MeshBuffersModule_Mesh_Pass.h @@ -67,7 +67,7 @@ class MeshBuffersModule_Mesh_Pass : public ShaderPass, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void SetModel(SceneModelWeak vSceneModel = SceneModelWeak()) override; void SetTexture(const uint32_t& vBindingPoint, vk::DescriptorImageInfo* vImageInfo, ct::fvec2* vTextureSize, void* vUserDatas = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; diff --git a/src/Graph/Modules/Widgets/Pass/WidgetColorModule_Pass.cpp b/src/Graph/Modules/Widgets/Pass/WidgetColorModule_Pass.cpp index 4e95afc84..9c784239c 100644 --- a/src/Graph/Modules/Widgets/Pass/WidgetColorModule_Pass.cpp +++ b/src/Graph/Modules/Widgets/Pass/WidgetColorModule_Pass.cpp @@ -75,7 +75,7 @@ bool WidgetColorModule_Pass::DrawOverlays( } bool WidgetColorModule_Pass::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); return false; diff --git a/src/Graph/Modules/Widgets/Pass/WidgetColorModule_Pass.h b/src/Graph/Modules/Widgets/Pass/WidgetColorModule_Pass.h index 9bd1e25f1..f65f7634c 100644 --- a/src/Graph/Modules/Widgets/Pass/WidgetColorModule_Pass.h +++ b/src/Graph/Modules/Widgets/Pass/WidgetColorModule_Pass.h @@ -59,7 +59,7 @@ class WidgetColorModule_Pass : public ShaderPass, public NodeInterface, public T bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawNodeWidget(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas) override; diff --git a/src/Graph/Modules/Widgets/VariableModule.cpp b/src/Graph/Modules/Widgets/VariableModule.cpp index fdbf0de5b..3017aeadf 100644 --- a/src/Graph/Modules/Widgets/VariableModule.cpp +++ b/src/Graph/Modules/Widgets/VariableModule.cpp @@ -114,7 +114,7 @@ bool VariableModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& v } bool VariableModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Widgets/VariableModule.h b/src/Graph/Modules/Widgets/VariableModule.h index 7c3305a4f..f2a8452f0 100644 --- a/src/Graph/Modules/Widgets/VariableModule.h +++ b/src/Graph/Modules/Widgets/VariableModule.h @@ -50,7 +50,7 @@ class VariableModule : public conf::ConfigAbstract, public GuiInterface, public bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; bool setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vParent, const std::string& vUserDatas = "") override; bool DrawNodeWidget(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr = nullptr) override; diff --git a/src/Graph/Modules/Widgets/WidgetColorModule.cpp b/src/Graph/Modules/Widgets/WidgetColorModule.cpp index 466136aa9..2513e0324 100644 --- a/src/Graph/Modules/Widgets/WidgetColorModule.cpp +++ b/src/Graph/Modules/Widgets/WidgetColorModule.cpp @@ -135,7 +135,7 @@ bool WidgetColorModule::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect } bool WidgetColorModule::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Modules/Widgets/WidgetColorModule.h b/src/Graph/Modules/Widgets/WidgetColorModule.h index 0cf3b8f61..0a03f3790 100644 --- a/src/Graph/Modules/Widgets/WidgetColorModule.h +++ b/src/Graph/Modules/Widgets/WidgetColorModule.h @@ -66,7 +66,7 @@ class WidgetColorModule : public BaseRenderer, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawNodeWidget(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Graph/Nodes/Assets/Load/CubeMapNode.cpp b/src/Graph/Nodes/Assets/Load/CubeMapNode.cpp index 60542ca59..1e0d97a2f 100644 --- a/src/Graph/Nodes/Assets/Load/CubeMapNode.cpp +++ b/src/Graph/Nodes/Assets/Load/CubeMapNode.cpp @@ -105,12 +105,12 @@ bool CubeMapNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRec } bool CubeMapNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_CubeMapModulePtr) { - return m_CubeMapModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_CubeMapModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Assets/Load/CubeMapNode.h b/src/Graph/Nodes/Assets/Load/CubeMapNode.h index 715d493dd..21403c922 100644 --- a/src/Graph/Nodes/Assets/Load/CubeMapNode.h +++ b/src/Graph/Nodes/Assets/Load/CubeMapNode.h @@ -38,7 +38,7 @@ class CubeMapNode : public TextureCubeOutputInterface, public BaseNode { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; // Interfaces Getters diff --git a/src/Graph/Nodes/Assets/Load/MeshNode.cpp b/src/Graph/Nodes/Assets/Load/MeshNode.cpp index 54ae2b7ac..e63d89e6b 100644 --- a/src/Graph/Nodes/Assets/Load/MeshNode.cpp +++ b/src/Graph/Nodes/Assets/Load/MeshNode.cpp @@ -72,12 +72,12 @@ bool MeshNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, return false; } -bool MeshNode::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { +bool MeshNode::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_MeshModule) { - return m_MeshModule->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_MeshModule->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Assets/Load/MeshNode.h b/src/Graph/Nodes/Assets/Load/MeshNode.h index 6b42f9dd4..34b861c8b 100644 --- a/src/Graph/Nodes/Assets/Load/MeshNode.h +++ b/src/Graph/Nodes/Assets/Load/MeshNode.h @@ -36,7 +36,7 @@ class MeshNode : public BaseNode, public ModelOutputInterface { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; SceneModelWeak GetModel() override; void DrawOutputWidget(BaseNodeState* vBaseNodeState, NodeSlotWeak vSlot) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Graph/Nodes/Assets/Load/Texture2DNode.cpp b/src/Graph/Nodes/Assets/Load/Texture2DNode.cpp index 54fbea257..3ca77897b 100644 --- a/src/Graph/Nodes/Assets/Load/Texture2DNode.cpp +++ b/src/Graph/Nodes/Assets/Load/Texture2DNode.cpp @@ -77,12 +77,12 @@ bool Texture2DNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vR } bool Texture2DNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_Texture2DModule) { - return m_Texture2DModule->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_Texture2DModule->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Assets/Load/Texture2DNode.h b/src/Graph/Nodes/Assets/Load/Texture2DNode.h index 4fca1ed53..7aa5db28e 100644 --- a/src/Graph/Nodes/Assets/Load/Texture2DNode.h +++ b/src/Graph/Nodes/Assets/Load/Texture2DNode.h @@ -37,7 +37,7 @@ class Texture2DNode : public BaseNode, public Texture2DOutputInterface { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; void DrawOutputWidget(BaseNodeState* vBaseNodeState, NodeSlotWeak vSlot) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Graph/Nodes/Assets/Save/ModelExporterNode.cpp b/src/Graph/Nodes/Assets/Save/ModelExporterNode.cpp index bd40def45..7b6308d12 100644 --- a/src/Graph/Nodes/Assets/Save/ModelExporterNode.cpp +++ b/src/Graph/Nodes/Assets/Save/ModelExporterNode.cpp @@ -130,14 +130,14 @@ bool ModelExporterNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect } bool ModelExporterNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_ModelExporterModulePtr) { - return m_ModelExporterModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_ModelExporterModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Assets/Save/ModelExporterNode.h b/src/Graph/Nodes/Assets/Save/ModelExporterNode.h index 1f3365605..c7ada02a3 100644 --- a/src/Graph/Nodes/Assets/Save/ModelExporterNode.h +++ b/src/Graph/Nodes/Assets/Save/ModelExporterNode.h @@ -43,7 +43,7 @@ class ModelExporterNode : public ModelInputInterface, public ModelOutputInterfac bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; // Interfaces Setters diff --git a/src/Graph/Nodes/Assets/Save/TextureExporterNode.cpp b/src/Graph/Nodes/Assets/Save/TextureExporterNode.cpp index 6cf3d12dc..fdcb92771 100644 --- a/src/Graph/Nodes/Assets/Save/TextureExporterNode.cpp +++ b/src/Graph/Nodes/Assets/Save/TextureExporterNode.cpp @@ -104,14 +104,14 @@ bool TextureExporterNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRe } bool TextureExporterNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_TextureExporterModulePtr) { - return m_TextureExporterModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_TextureExporterModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Assets/Save/TextureExporterNode.h b/src/Graph/Nodes/Assets/Save/TextureExporterNode.h index 0a25b30d2..87bdb7852 100644 --- a/src/Graph/Nodes/Assets/Save/TextureExporterNode.h +++ b/src/Graph/Nodes/Assets/Save/TextureExporterNode.h @@ -37,7 +37,7 @@ class TextureExporterNode : public Texture2DInputInterface<0U>, public BaseNode bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; // Interfaces Setters void SetTexture(const uint32_t& vBindingPoint, vk::DescriptorImageInfo* vImageInfo, ct::fvec2* vTextureSize, void* vUserDatas = nullptr) override; diff --git a/src/Graph/Nodes/Misc/GridNode.cpp b/src/Graph/Nodes/Misc/GridNode.cpp index 50d9a38a6..11544019b 100644 --- a/src/Graph/Nodes/Misc/GridNode.cpp +++ b/src/Graph/Nodes/Misc/GridNode.cpp @@ -87,7 +87,7 @@ bool GridNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, return false; } -bool GridNode::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { +bool GridNode::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); diff --git a/src/Graph/Nodes/Misc/GridNode.h b/src/Graph/Nodes/Misc/GridNode.h index 4dc454027..e7adfe10b 100644 --- a/src/Graph/Nodes/Misc/GridNode.h +++ b/src/Graph/Nodes/Misc/GridNode.h @@ -40,7 +40,7 @@ class GridNode : public BaseNode, public Texture2DOutputInterface, public Shader bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; diff --git a/src/Graph/Nodes/Misc/SceneMergerNode.cpp b/src/Graph/Nodes/Misc/SceneMergerNode.cpp index 7f7a26fdc..8b4ebc026 100644 --- a/src/Graph/Nodes/Misc/SceneMergerNode.cpp +++ b/src/Graph/Nodes/Misc/SceneMergerNode.cpp @@ -130,14 +130,14 @@ bool SceneMergerNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& } bool SceneMergerNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_SceneMergerModulePtr) { - return m_SceneMergerModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_SceneMergerModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Misc/SceneMergerNode.h b/src/Graph/Nodes/Misc/SceneMergerNode.h index 57db602b3..35c420fd2 100644 --- a/src/Graph/Nodes/Misc/SceneMergerNode.h +++ b/src/Graph/Nodes/Misc/SceneMergerNode.h @@ -48,7 +48,7 @@ class SceneMergerNode : public Texture2DInputInterface<0U>, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; // Resize diff --git a/src/Graph/Nodes/Renderers/MatcapRendererNode.cpp b/src/Graph/Nodes/Renderers/MatcapRendererNode.cpp index 91abf8f6b..a19f0f854 100644 --- a/src/Graph/Nodes/Renderers/MatcapRendererNode.cpp +++ b/src/Graph/Nodes/Renderers/MatcapRendererNode.cpp @@ -100,12 +100,12 @@ bool MatcapRendererNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRec } bool MatcapRendererNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_MatcapRenderer) { - return m_MatcapRenderer->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_MatcapRenderer->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Renderers/MatcapRendererNode.h b/src/Graph/Nodes/Renderers/MatcapRendererNode.h index 7eede66b2..e13ab387f 100644 --- a/src/Graph/Nodes/Renderers/MatcapRendererNode.h +++ b/src/Graph/Nodes/Renderers/MatcapRendererNode.h @@ -49,7 +49,7 @@ class MatcapRendererNode : public BaseNode, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void SetModel(SceneModelWeak vSceneModel = SceneModelWeak()) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; diff --git a/src/Graph/Nodes/Renderers/ModelRendererNode.cpp b/src/Graph/Nodes/Renderers/ModelRendererNode.cpp index c0705b6a9..8183a8094 100644 --- a/src/Graph/Nodes/Renderers/ModelRendererNode.cpp +++ b/src/Graph/Nodes/Renderers/ModelRendererNode.cpp @@ -139,13 +139,13 @@ bool ModelRendererNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect return false; } -bool ModelRendererNode::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) +bool ModelRendererNode::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_ModelRendererModulePtr) { - return m_ModelRendererModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_ModelRendererModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Renderers/ModelRendererNode.h b/src/Graph/Nodes/Renderers/ModelRendererNode.h index d362e2154..7de90bba5 100644 --- a/src/Graph/Nodes/Renderers/ModelRendererNode.h +++ b/src/Graph/Nodes/Renderers/ModelRendererNode.h @@ -50,7 +50,7 @@ class ModelRendererNode : // Draw Widgets bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; - bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; // Resize diff --git a/src/Graph/Nodes/Utils/MathNode.cpp b/src/Graph/Nodes/Utils/MathNode.cpp index 6b27667ef..59f7e6c2b 100644 --- a/src/Graph/Nodes/Utils/MathNode.cpp +++ b/src/Graph/Nodes/Utils/MathNode.cpp @@ -114,12 +114,12 @@ bool MathNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, return false; } -bool MathNode::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { +bool MathNode::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_MathModulePtr) { - return m_MathModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_MathModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; diff --git a/src/Graph/Nodes/Utils/MathNode.h b/src/Graph/Nodes/Utils/MathNode.h index 33d821bca..85de4b1ca 100644 --- a/src/Graph/Nodes/Utils/MathNode.h +++ b/src/Graph/Nodes/Utils/MathNode.h @@ -37,7 +37,7 @@ class MathNode : public BaseNode, public Texture2DInputInterface<0U>, public Tex bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; void TreatNotification(const NotifyEvent& vEvent, const NodeSlotWeak& vEmitterSlot, const NodeSlotWeak& vReceiverSlot) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; diff --git a/src/Graph/Nodes/Utils/MeshBuffersNode.cpp b/src/Graph/Nodes/Utils/MeshBuffersNode.cpp index d91bac2ea..b88740b29 100644 --- a/src/Graph/Nodes/Utils/MeshBuffersNode.cpp +++ b/src/Graph/Nodes/Utils/MeshBuffersNode.cpp @@ -104,12 +104,12 @@ bool MeshBuffersNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& } bool MeshBuffersNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_MeshBuffersModulePtr) { - return m_MeshBuffersModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_MeshBuffersModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; diff --git a/src/Graph/Nodes/Utils/MeshBuffersNode.h b/src/Graph/Nodes/Utils/MeshBuffersNode.h index 76ed12923..7587a891f 100644 --- a/src/Graph/Nodes/Utils/MeshBuffersNode.h +++ b/src/Graph/Nodes/Utils/MeshBuffersNode.h @@ -46,7 +46,7 @@ class MeshBuffersNode : public BaseNode, bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void SetModel(SceneModelWeak vSceneModel = SceneModelWeak()) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; void NeedResizeByResizeEvent(ct::ivec2* vNewSize, const uint32_t* vCountColorBuffers) override; diff --git a/src/Graph/Nodes/Widgets/VariableNode.cpp b/src/Graph/Nodes/Widgets/VariableNode.cpp index 8c0a90fce..d515e4586 100644 --- a/src/Graph/Nodes/Widgets/VariableNode.cpp +++ b/src/Graph/Nodes/Widgets/VariableNode.cpp @@ -95,12 +95,12 @@ bool VariableNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRe } bool VariableNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_VariableModulePtr) { - return m_VariableModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_VariableModulePtr->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; diff --git a/src/Graph/Nodes/Widgets/VariableNode.h b/src/Graph/Nodes/Widgets/VariableNode.h index 0afc321db..1645e1b53 100644 --- a/src/Graph/Nodes/Widgets/VariableNode.h +++ b/src/Graph/Nodes/Widgets/VariableNode.h @@ -35,7 +35,7 @@ class VariableNode : public BaseNode, public VariableOutputInterface { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; bool setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vParent, const std::string& vUserDatas) override; diff --git a/src/Graph/Nodes/Widgets/WidgetColorNode.cpp b/src/Graph/Nodes/Widgets/WidgetColorNode.cpp index 1699b9b6f..6544ca568 100644 --- a/src/Graph/Nodes/Widgets/WidgetColorNode.cpp +++ b/src/Graph/Nodes/Widgets/WidgetColorNode.cpp @@ -95,12 +95,12 @@ bool WidgetColorNode::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& } bool WidgetColorNode::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); if (m_WidgetColorModule) { - return m_WidgetColorModule->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return m_WidgetColorModule->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } return false; } diff --git a/src/Graph/Nodes/Widgets/WidgetColorNode.h b/src/Graph/Nodes/Widgets/WidgetColorNode.h index ce8e19921..a8dcf5586 100644 --- a/src/Graph/Nodes/Widgets/WidgetColorNode.h +++ b/src/Graph/Nodes/Widgets/WidgetColorNode.h @@ -40,7 +40,7 @@ class WidgetColorNode : public BaseNode, public Texture2DOutputInterface { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DisplayInfosOnTopOfTheNode(BaseNodeState* vBaseNodeState) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(const uint32_t& vBindingPoint, ct::fvec2* vOutSize = nullptr, void* vUserDatas = nullptr) override; std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Headers/LumoBuild.h b/src/Headers/LumoBuild.h index 10e277b0c..e31c42c3b 100644 --- a/src/Headers/LumoBuild.h +++ b/src/Headers/LumoBuild.h @@ -1,7 +1,7 @@ #pragma once #define Lumo_Prefix "Lumo" -#define Lumo_BuildNumber 5582 +#define Lumo_BuildNumber 5595 #define Lumo_MinorNumber 0 #define Lumo_MajorNumber 0 -#define Lumo_BuildId "0.0.5582" +#define Lumo_BuildId "0.0.5595" diff --git a/src/Panes/AnimatePane.cpp b/src/Panes/AnimatePane.cpp index b4f9ba7f4..49c290e76 100644 --- a/src/Panes/AnimatePane.cpp +++ b/src/Panes/AnimatePane.cpp @@ -32,16 +32,16 @@ void AnimatePane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool AnimatePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool AnimatePane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; UNUSED(vCurrentFrame); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); bool change = false; - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -80,10 +80,10 @@ bool AnimatePane::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRec } bool AnimatePane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; UNUSED(vCurrentFrame); - UNUSED(vMaxSize); + UNUSED(vMaxRect); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); return false; diff --git a/src/Panes/AnimatePane.h b/src/Panes/AnimatePane.h index a938d6790..46c1bab1f 100644 --- a/src/Panes/AnimatePane.h +++ b/src/Panes/AnimatePane.h @@ -99,9 +99,9 @@ class AnimatePane : public AbstractPane { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; public: // singleton static std::shared_ptr Instance() { diff --git a/src/Panes/ConsolePane.cpp b/src/Panes/ConsolePane.cpp index 8dfcee26c..a263aa253 100644 --- a/src/Panes/ConsolePane.cpp +++ b/src/Panes/ConsolePane.cpp @@ -32,16 +32,16 @@ void ConsolePane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool ConsolePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool ConsolePane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; UNUSED(vCurrentFrame); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); bool change = false; - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -77,10 +77,10 @@ bool ConsolePane::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRec } bool ConsolePane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; UNUSED(vCurrentFrame); - UNUSED(vMaxSize); + UNUSED(vMaxRect); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); return false; diff --git a/src/Panes/ConsolePane.h b/src/Panes/ConsolePane.h index 5532e042a..67b6f52d4 100644 --- a/src/Panes/ConsolePane.h +++ b/src/Panes/ConsolePane.h @@ -14,9 +14,9 @@ class ConsolePane : public AbstractPane { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; public: // singleton static std::shared_ptr Instance() { diff --git a/src/Panes/DebugPane.cpp b/src/Panes/DebugPane.cpp index 9cb55b72a..319ef601d 100644 --- a/src/Panes/DebugPane.cpp +++ b/src/Panes/DebugPane.cpp @@ -54,15 +54,15 @@ void DebugPane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool DebugPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool DebugPane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; UNUSED(vCurrentFrame); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -85,7 +85,7 @@ bool DebugPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneSh } bool DebugPane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { if (ProjectFile::Instance()->IsProjectLoaded()) { /*ImVec2 maxSize = MainFrame::Instance()->m_DisplaySize; ImVec2 minSize = maxSize * 0.5f; diff --git a/src/Panes/DebugPane.h b/src/Panes/DebugPane.h index b482974d0..c6ad2281b 100644 --- a/src/Panes/DebugPane.h +++ b/src/Panes/DebugPane.h @@ -40,9 +40,9 @@ class DebugPane : public AbstractPane, public NodeInterface { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void Select(BaseNodeWeak vObjet); public: // singleton diff --git a/src/Panes/GraphPane.cpp b/src/Panes/GraphPane.cpp index 7368bfb49..6ea6aac6b 100644 --- a/src/Panes/GraphPane.cpp +++ b/src/Panes/GraphPane.cpp @@ -103,18 +103,18 @@ void GraphPane::DrawProperties() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool GraphPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool GraphPane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { bool change = false; - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { // main graph bool opened = true; - change = DrawGraph(NodeManager::Instance()->m_RootNodePtr, opened, true, 0, vInOutPaneShown); + change = DrawGraph(NodeManager::Instance()->m_RootNodePtr, opened, true, 0, vOpened); // childs graph size_t countPanes = m_GraphPanes.size(); for (auto nodeEntry : m_GraphPanes) { - change |= DrawGraph(nodeEntry.first, nodeEntry.second, false, countPanes, vInOutPaneShown); + change |= DrawGraph(nodeEntry.first, nodeEntry.second, false, countPanes, vOpened); } } @@ -126,7 +126,7 @@ bool GraphPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneSh } bool GraphPane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { return false; } @@ -162,7 +162,7 @@ void GraphPane::AddGraphPane(BaseNodeWeak vNodeGraphToShow) { m_GraphPanes.emplace_back(vNodeGraphToShow, true); nodePtr->InitGraph(); nodePtr->uniquePaneId = nodePtr->name + "##" + ct::toStr((int)nodePtr->GetNodeID()); - LayoutManager::Instance()->AddSpecificPaneToExisting(nodePtr->uniquePaneId.c_str(), paneName); + LayoutManager::Instance()->AddSpecificPaneToExisting(nodePtr->uniquePaneId.c_str(), GetName()); } LayoutManager::Instance()->FocusSpecificPane(nodePtr->uniquePaneId.c_str()); @@ -222,17 +222,17 @@ bool GraphPane::setFromXml(tinyxml2::XMLElement* vElem, tinyxml2::XMLElement* vP //// PRIVATE ////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool GraphPane::DrawGraph(BaseNodeWeak vNode, bool& vCanShow, bool vRootNode, size_t vInitialPanesCount, PaneFlags& vInOutPaneShown) { +bool GraphPane::DrawGraph(BaseNodeWeak vNode, bool& vCanShow, bool vRootNode, size_t vInitialPanesCount, bool* vOpened) { if (vCanShow) { if (!vNode.expired()) { auto nodeEntryPtr = vNode.lock(); if (nodeEntryPtr) { if (!nodeEntryPtr->uniquePaneId.empty() || vRootNode) { - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { if (vRootNode) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoScrollbar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -308,7 +308,7 @@ bool GraphPane::DrawGraph(BaseNodeWeak vNode, bool& vCanShow, bool vRootNode, si } else { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoScrollbar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { if (ImGui::Begin(nodeEntryPtr->uniquePaneId.c_str(), &vCanShow, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); diff --git a/src/Panes/GraphPane.h b/src/Panes/GraphPane.h index d45cece02..1944fca41 100644 --- a/src/Panes/GraphPane.h +++ b/src/Panes/GraphPane.h @@ -40,9 +40,9 @@ class GraphPane : public conf::ConfigAbstract, public AbstractPane { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void DrawDebugInfos(); void DrawProperties(); @@ -54,7 +54,7 @@ class GraphPane : public conf::ConfigAbstract, public AbstractPane { void ClearGraphPanes(); private: - bool DrawGraph(BaseNodeWeak vNode, bool& vCanShow, bool vRootNode, size_t vInitialPanesCount, PaneFlags& vInOutPaneShown); + bool DrawGraph(BaseNodeWeak vNode, bool& vCanShow, bool vRootNode, size_t vInitialPanesCount, bool* vOpened); public: std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/ProfilerPane.cpp b/src/Panes/ProfilerPane.cpp index e55e44862..05083e7ff 100644 --- a/src/Panes/ProfilerPane.cpp +++ b/src/Panes/ProfilerPane.cpp @@ -63,7 +63,7 @@ void ProfilerPane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool ProfilerPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool ProfilerPane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; UNUSED(vCurrentFrame); ImGui::SetCurrentContext(vContextPtr); @@ -72,10 +72,9 @@ bool ProfilerPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPan GaiApi::vkProfiler::Instance()->isActiveRef() = false; - if (vInOutPaneShown & paneFlag) { - m_InOutPaneShown = vInOutPaneShown; + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &m_InOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -94,8 +93,6 @@ bool ProfilerPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPan GaiApi::vkProfiler::Instance()->DrawFlamGraphChilds(); GaiApi::vkProfiler::Instance()->DrawDetails(); - - vInOutPaneShown = m_InOutPaneShown; } return change; @@ -111,10 +108,10 @@ bool ProfilerPane::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRe } bool ProfilerPane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; UNUSED(vCurrentFrame); - UNUSED(vMaxSize); + UNUSED(vMaxRect); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); return false; diff --git a/src/Panes/ProfilerPane.h b/src/Panes/ProfilerPane.h index e8bcba543..e1f624d3b 100644 --- a/src/Panes/ProfilerPane.h +++ b/src/Panes/ProfilerPane.h @@ -27,9 +27,6 @@ class ProjectFile; class ProfilerPane : public AbstractPane { -private: - PaneFlags m_InOutPaneShown = -1; - public: bool Init() override; void Unit() override; @@ -37,9 +34,9 @@ class ProfilerPane : public AbstractPane { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; public: // singleton static std::shared_ptr Instance() { diff --git a/src/Panes/SceneTreePane.cpp b/src/Panes/SceneTreePane.cpp index a2f78fe26..c67d15a33 100644 --- a/src/Panes/SceneTreePane.cpp +++ b/src/Panes/SceneTreePane.cpp @@ -50,12 +50,12 @@ void SceneTreePane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool SceneTreePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool SceneTreePane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -75,7 +75,7 @@ bool SceneTreePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPa } bool SceneTreePane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; if (ProjectFile::Instance()->IsProjectLoaded()) { diff --git a/src/Panes/SceneTreePane.h b/src/Panes/SceneTreePane.h index a7f0693c9..099b31861 100644 --- a/src/Panes/SceneTreePane.h +++ b/src/Panes/SceneTreePane.h @@ -19,7 +19,6 @@ limitations under the License. #include #include #include -#include #include #include #include @@ -33,9 +32,9 @@ class SceneTreePane : public AbstractPane { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; public: // singleton static std::shared_ptr Instance() { diff --git a/src/Panes/SceneViewPane.cpp b/src/Panes/SceneViewPane.cpp index 056b4919d..7740af64f 100644 --- a/src/Panes/SceneViewPane.cpp +++ b/src/Panes/SceneViewPane.cpp @@ -64,14 +64,14 @@ void SceneViewPane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool SceneViewPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool SceneViewPane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; bool change = false; - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -95,7 +95,8 @@ bool SceneViewPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPa ImGui::EndMenuBar(); } - ct::ivec2 contentSize = ImGui::GetContentRegionAvail(); + const auto& av = ImGui::GetContentRegionAvail(); + ct::ivec2 contentSize(av.x, av.y); if (m_ImGuiTexture.canDisplayPreview) { m_PreviewRect = ct::GetScreenRectWithRatio(m_ImGuiTexture.ratio, contentSize, false); @@ -114,8 +115,9 @@ bool SceneViewPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPa if (ImGui::IsWindowHovered()) { if (ImGui::IsMouseHoveringRect(org, org + siz)) { if (m_CanWeTuneMouse && m_CanUpdateMouse(true, 0)) { - ct::fvec2 norPos = (ImGui::GetMousePos() - org) / siz; - CommonSystem::Instance()->SetMousePos(norPos, m_PaneSize, ImGui::GetCurrentContext()->IO.MouseDown); + const auto& norPos = (ImGui::GetMousePos() - org) / siz; + CommonSystem::Instance()->SetMousePos( + ct::fvec2(norPos.x, norPos.y), m_PaneSize, ImGui::GetCurrentContext()->IO.MouseDown); } m_UpdateCamera(org, siz); @@ -155,9 +157,9 @@ bool SceneViewPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPa /////////////////////////////////////////////////////////////////////////////////// bool SceneViewPane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { UNUSED(vCurrentFrame); - UNUSED(vMaxSize); + UNUSED(vMaxRect); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); return false; diff --git a/src/Panes/SceneViewPane.h b/src/Panes/SceneViewPane.h index 35aa8999f..6f10e4091 100644 --- a/src/Panes/SceneViewPane.h +++ b/src/Panes/SceneViewPane.h @@ -21,7 +21,6 @@ limitations under the License. #include #include #include -#include #include #include #include @@ -56,9 +55,9 @@ class SceneViewPane : public AbstractPane { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void Select(BaseNodeWeak vObjet); void SetVulkanImGuiRenderer(VulkanImGuiRendererWeak vVulkanImGuiRenderer); diff --git a/src/Panes/TuningPane.cpp b/src/Panes/TuningPane.cpp index e950e7798..37f616413 100644 --- a/src/Panes/TuningPane.cpp +++ b/src/Panes/TuningPane.cpp @@ -71,14 +71,14 @@ void TuningPane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool TuningPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool TuningPane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; bool change = false; - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -102,7 +102,7 @@ bool TuningPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneS /////////////////////////////////////////////////////////////////////////////////// bool TuningPane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; return false; diff --git a/src/Panes/TuningPane.h b/src/Panes/TuningPane.h index 4c94c2d8f..67c59bc6f 100644 --- a/src/Panes/TuningPane.h +++ b/src/Panes/TuningPane.h @@ -20,7 +20,6 @@ limitations under the License. #include #include #include -#include #include #include #include @@ -35,9 +34,9 @@ class TuningPane : public AbstractPane, public NodeInterface { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void Select(BaseNodeWeak vObjet); public: // singleton diff --git a/src/Panes/View2DPane.cpp b/src/Panes/View2DPane.cpp index f57e8d21e..e87c6e0f6 100644 --- a/src/Panes/View2DPane.cpp +++ b/src/Panes/View2DPane.cpp @@ -67,14 +67,14 @@ void View2DPane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool View2DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool View2DPane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; bool change = false; - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -96,7 +96,8 @@ bool View2DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneS ImGui::EndMenuBar(); } - ct::ivec2 maxSize = ImGui::GetContentRegionAvail(); + const auto& av = ImGui::GetContentRegionAvail(); + ct::ivec2 maxSize(av.x, av.y); if (m_ImGuiTexture.canDisplayPreview) { m_PreviewRect = ct::GetScreenRectWithRatio(m_ImGuiTexture.ratio, maxSize, false); @@ -112,8 +113,9 @@ bool View2DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneS if (ImGui::IsWindowHovered()) { if (ImGui::IsMouseHoveringRect(org, org + siz)) { if (m_CanWeTuneMouse && CanUpdateMouse(true, 0)) { - ct::fvec2 norPos = (ImGui::GetMousePos() - org) / siz; - CommonSystem::Instance()->SetMousePos(norPos, outputSize, ImGui::GetCurrentContext()->IO.MouseDown); + const auto& norPos = (ImGui::GetMousePos() - org) / siz; + CommonSystem::Instance()->SetMousePos( + ct::fvec2(norPos.x, norPos.y), outputSize, ImGui::GetCurrentContext()->IO.MouseDown); } } } @@ -133,7 +135,7 @@ bool View2DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneS /////////////////////////////////////////////////////////////////////////////////// bool View2DPane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; return false; diff --git a/src/Panes/View2DPane.h b/src/Panes/View2DPane.h index 79bb8a757..96e170ae6 100644 --- a/src/Panes/View2DPane.h +++ b/src/Panes/View2DPane.h @@ -20,7 +20,6 @@ limitations under the License. #include #include #include -#include #include #include #include @@ -52,9 +51,9 @@ class View2DPane : public AbstractPane { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void Select(BaseNodeWeak vObjet); ct::fvec2 SetOrUpdateOutput(NodeSlotWeak vTexture2DOutputSlot); diff --git a/src/Panes/View3DPane.cpp b/src/Panes/View3DPane.cpp index 0364387ea..4c42550a6 100644 --- a/src/Panes/View3DPane.cpp +++ b/src/Panes/View3DPane.cpp @@ -67,14 +67,14 @@ void View3DPane::Unit() { //// IMGUI PANE /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// -bool View3DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { +bool View3DPane::DrawPanes(const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; bool change = false; - if (vInOutPaneShown & paneFlag) { + if (vOpened && *vOpened) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; - if (ImGui::Begin(paneName.c_str(), &vInOutPaneShown, paneFlag, flags)) { + if (ImGui::Begin(GetName().c_str(), vOpened, flags)) { #ifdef USE_DECORATIONS_FOR_RESIZE_CHILD_WINDOWS auto win = ImGui::GetCurrentWindowRead(); if (win->Viewport->Idx != 0) @@ -103,7 +103,8 @@ bool View3DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneS ImGui::EndMenuBar(); } - ct::ivec2 contentSize = ImGui::GetContentRegionAvail(); + const auto& av = ImGui::GetContentRegionAvail(); + ct::ivec2 contentSize(av.x, av.y); if (m_ImGuiTexture.canDisplayPreview) { m_PreviewRect = ct::GetScreenRectWithRatio(m_ImGuiTexture.ratio, contentSize, false); @@ -122,8 +123,9 @@ bool View3DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneS if (ImGui::IsWindowHovered()) { if (ImGui::IsMouseHoveringRect(org, org + siz)) { if (m_CanWeTuneMouse && m_CanUpdateMouse(true, 0)) { - ct::fvec2 norPos = (ImGui::GetMousePos() - org) / siz; - CommonSystem::Instance()->SetMousePos(norPos, m_PaneSize, ImGui::GetCurrentContext()->IO.MouseDown); + const auto& norPos = (ImGui::GetMousePos() - org) / siz; + CommonSystem::Instance()->SetMousePos( + ct::fvec2(norPos.x, norPos.y), m_PaneSize, ImGui::GetCurrentContext()->IO.MouseDown); } m_UpdateCamera(org, siz); @@ -136,7 +138,7 @@ bool View3DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneS } } - // on test ca car si le vue n'est pas visible cad si maxSize.y est inferieur a 0 alors + // on test ca car si le vue n'est pas visible cad si contentSize.y est inferieur a 0 alors // on a affaire a un resize constant, car outputsize n'est jamais maj, tant que la vue n'a pas rendu // et ca casse le fps de l'ui, rendu son utilisation impossible ( deltatime superieur 32ms d'apres tracy sur un gtx 1050 Ti) if (contentSize.x > 0 && contentSize.y > 0) { @@ -167,9 +169,9 @@ bool View3DPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneS /////////////////////////////////////////////////////////////////////////////////// bool View3DPane::DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { UNUSED(vCurrentFrame); - UNUSED(vMaxSize); + UNUSED(vMaxRect); ImGui::SetCurrentContext(vContextPtr); UNUSED(vUserDatas); return false; diff --git a/src/Panes/View3DPane.h b/src/Panes/View3DPane.h index c0f406ec6..648151c79 100644 --- a/src/Panes/View3DPane.h +++ b/src/Panes/View3DPane.h @@ -21,7 +21,6 @@ limitations under the License. #include #include #include -#include #include #include #include @@ -57,9 +56,9 @@ class View3DPane : public AbstractPane { bool DrawOverlays( const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawPanes( - const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, bool* vOpened, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool DrawDialogsAndPopups( - const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; void Select(BaseNodeWeak vObjet); ct::fvec2 SetOrUpdateOutput(NodeSlotWeak vTexture2DOutputSlot); diff --git a/src/Scene/Manager/SceneManager.cpp b/src/Scene/Manager/SceneManager.cpp index 09123aa25..f3df719d8 100644 --- a/src/Scene/Manager/SceneManager.cpp +++ b/src/Scene/Manager/SceneManager.cpp @@ -87,11 +87,11 @@ bool SceneManager::DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRe return SceneMerger::Instance()->DrawOverlays(vCurrentFrame, vRect, vContextPtr, vUserDatas); } -bool SceneManager::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { +bool SceneManager::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) { ZoneScoped; assert(vContextPtr); ImGui::SetCurrentContext(vContextPtr); - return SceneMerger::Instance()->DrawDialogsAndPopups(vCurrentFrame, vMaxSize, vContextPtr, vUserDatas); + return SceneMerger::Instance()->DrawDialogsAndPopups(vCurrentFrame, vMaxRect, vContextPtr, vUserDatas); } //////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/Scene/Manager/SceneManager.h b/src/Scene/Manager/SceneManager.h index bec2ae747..3883d3bc3 100644 --- a/src/Scene/Manager/SceneManager.h +++ b/src/Scene/Manager/SceneManager.h @@ -35,7 +35,7 @@ class SceneManager : public GuiInterface, public TaskInterface { bool DrawWidgets(const uint32_t& vCurrentFrame, ImGuiContext* vContextPtr, void* vUserDatas) override; bool DrawOverlays(const uint32_t& vCurrentFrame, const ImRect& vRect, ImGuiContext* vContextPtr, void* vUserDatas) override; - bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) override; + bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImRect& vMaxRect, ImGuiContext* vContextPtr, void* vUserDatas) override; vk::DescriptorImageInfo* GetDescriptorImageInfo(ct::fvec2* vOutSize);