From abcf06b97fc125b02d2da91443b59421f11b08b6 Mon Sep 17 00:00:00 2001 From: aiekick Date: Tue, 12 Mar 2024 02:31:12 +0100 Subject: [PATCH] [RFR] : refactor for the new LayoutManager --- .clang-format | 23 +++++++++++------------ 3rdparty/SoGLSL | 2 +- CMakeLists.txt | 26 ++++++++++++++------------ src/Backends/MainBackend.cpp | 1 + src/Gui/MainFrame.cpp | 30 +++++++++++++++--------------- src/Headers/NoodlesPlateBuild.h | 4 ++-- src/Panes/BufferPreview.cpp | 2 +- src/Panes/BufferPreview.h | 2 +- src/Panes/CodePane.cpp | 2 +- src/Panes/CodePane.h | 2 +- src/Panes/ConfigPane.cpp | 2 +- src/Panes/ConfigPane.h | 2 +- src/Panes/ConfigSwitcherPane.cpp | 4 ++-- src/Panes/ConfigSwitcherPane.h | 4 ++-- src/Panes/ConsolePane.cpp | 2 +- src/Panes/ConsolePane.h | 2 +- src/Panes/HelpPane.cpp | 2 +- src/Panes/HelpPane.h | 2 +- src/Panes/InfosPane.cpp | 2 +- src/Panes/InfosPane.h | 2 +- src/Panes/InspectorPane.cpp | 2 +- src/Panes/InspectorPane.h | 2 +- src/Panes/MessagePane.cpp | 2 +- src/Panes/MessagePane.h | 2 +- src/Panes/NodesPane.cpp | 2 +- src/Panes/NodesPane.h | 2 +- src/Panes/ProfilerPane.cpp | 3 ++- src/Panes/ProfilerPane.h | 2 +- src/Panes/TimeLinePane.cpp | 2 +- src/Panes/TimeLinePane.h | 2 +- src/Panes/UniformsPane.cpp | 2 +- src/Panes/UniformsPane.h | 2 +- src/Panes/VRPane.cpp | 2 +- src/Panes/VRPane.h | 2 +- src/main.cpp | 7 ++++--- 35 files changed, 79 insertions(+), 75 deletions(-) diff --git a/.clang-format b/.clang-format index bf37b87..95c8d59 100644 --- a/.clang-format +++ b/.clang-format @@ -1,7 +1,7 @@ --- BasedOnStyle: Google Language: Cpp -Standard: Cpp03 +Standard: Latest AccessModifierOffset: -4 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false @@ -17,14 +17,14 @@ AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: Yes -BinPackArguments: true -BinPackParameters: true +BinPackArguments: false +BinPackParameters: false BraceWrapping: AfterClass: false AfterControlStatement: false - AfterEnum: false + AfterEnum: true AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false @@ -34,9 +34,9 @@ BraceWrapping: BeforeCatch: false BeforeElse: false IndentBraces: false - SplitEmptyFunction: true - SplitEmptyRecord: true - SplitEmptyNamespace: true + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach BreakBeforeInheritanceComma: false @@ -46,7 +46,7 @@ BreakConstructorInitializersBeforeComma: false BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true -ColumnLimit: 150 +ColumnLimit: 170 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true @@ -89,9 +89,9 @@ ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1 -PenaltyBreakComment: 300 +PenaltyBreakComment: 200 PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 +PenaltyBreakString: 200 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 200 @@ -142,7 +142,6 @@ SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false -Standard: Auto StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION diff --git a/3rdparty/SoGLSL b/3rdparty/SoGLSL index 90d383b..a84932b 160000 --- a/3rdparty/SoGLSL +++ b/3rdparty/SoGLSL @@ -1 +1 @@ -Subproject commit 90d383b7521de1fd0f4dc3665b5a38d08f9a3443 +Subproject commit a84932bee3aa5a3d78a048567bc11602e7d6373e diff --git a/CMakeLists.txt b/CMakeLists.txt index 83dd1c2..77e9a03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ set(CMAKE_PDB_OUTPUT_DIRECTORY "${FINAL_BIN_DIR}/debug") ## some defines for debug mode (before 3rdparty.cmake) if(MSVC) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") ## MT in release or MTd in debug - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG /Zi") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W4 -D_DEBUG /Zi") else() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -g") endif() @@ -84,7 +84,7 @@ add_definitions(-DCUSTOM_SOGLSL_CONFIG="${CMAKE_SOURCE_DIR}/src/Headers/CustomSo add_definitions(-DCUSTOM_IMWIDGETS_CONFIG="${CMAKE_SOURCE_DIR}/src/Headers/CustomImWidgetsConfig.h") add_definitions(-DCUSTOM_IN_APP_GPU_PROFILER_CONFIG="${CMAKE_SOURCE_DIR}/src/Headers/CustomInAppGpuProfiler.h") add_definitions(-DCUSTOM_IMGUIFILEDIALOG_CONFIG="${CMAKE_SOURCE_DIR}/src/Headers/CustomImGuiFileDialogConfig.h") -add_definitions(-DUSE_IMGUI="${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/imgui.h") +add_definitions(-DIMGUI_INCLUDE="${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/imgui.h") set(LLVM_USE_CRT_DEBUG MTd CACHE STRING "" FORCE) set(LLVM_USE_CRT_MINSIZEREL MT CACHE STRING "" FORCE) @@ -155,16 +155,16 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX src FILES ${PROJECT_SRC if (USE_SDL) file(GLOB IMGUI_IMPL_SRC - ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/backends/imgui_impl_opengl3.cpp - ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/backends/imgui_impl_opengl3.h - ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/backends/imgui_impl_sdl.cpp - ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/backends/imgui_impl_sdl.h) + ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/backends/imgui_impl_opengl3.cpp + ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/backends/imgui_impl_opengl3.h + ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/backends/imgui_impl_sdl.cpp + ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/backends/imgui_impl_sdl.h) else() file(GLOB IMGUI_IMPL_SRC - ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/backends/imgui_impl_opengl3.cpp - ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/backends/imgui_impl_opengl3.h - ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/backends/imgui_impl_glfw.cpp - ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui/backends/imgui_impl_glfw.h) + ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/backends/imgui_impl_opengl3.cpp + ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/backends/imgui_impl_opengl3.h + ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/backends/imgui_impl_glfw.cpp + ${CMAKE_SOURCE_DIR}/3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui_docking/backends/imgui_impl_glfw.h) endif() source_group(src/Impl FILES ${IMGUI_IMPL_SRC}) @@ -186,8 +186,8 @@ add_executable(${PROJECT} if (USE_IMPLOT) target_compile_definitions(${PROJECT} PUBLIC USE_IMPLOT) endif() -if (USE_IMCOOL_BAR) - target_compile_definitions(${PROJECT} PUBLIC USE_IMCOOL_BAR) +if (USE_IM_COOL_BAR) + target_compile_definitions(${PROJECT} PUBLIC USE_IM_COOL_BAR) endif() if (USE_IM_GRADIENT_HDR) target_compile_definitions(${PROJECT} PUBLIC USE_IM_GRADIENT_HDR) @@ -296,6 +296,8 @@ include_directories( include 3rdparty 3rdparty/SoGLSL + 3rdparty/SoGLSL/3rdparty/ImGuiPack + 3rdparty/SoGLSL/3rdparty/ImGuiPack/3rdparty/imgui ${ZLIB_INCLUDE_DIR} ${NVAPI_INCLUDE_DIR} ${SOGSL_INCLUDE_DIRS} diff --git a/src/Backends/MainBackend.cpp b/src/Backends/MainBackend.cpp index b581d7e..25dc96b 100644 --- a/src/Backends/MainBackend.cpp +++ b/src/Backends/MainBackend.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/src/Gui/MainFrame.cpp b/src/Gui/MainFrame.cpp index b14f79c..9f0f746 100644 --- a/src/Gui/MainFrame.cpp +++ b/src/Gui/MainFrame.cpp @@ -144,27 +144,27 @@ bool MainFrame::Init() { PathSystem::Instance()->Save(); // apply paths who was loaded before in LoadConfigFile - LayoutManager::Instance()->SetPaneDisposalSize(PaneDisposal::LEFT, 300.0f); - LayoutManager::Instance()->SetPaneDisposalSize(PaneDisposal::RIGHT, 300.0f); - LayoutManager::Instance()->SetPaneDisposalSize(PaneDisposal::BOTTOM, 300.0f); + LayoutManager::Instance()->SetPaneDisposalRatio("LEFT", 0.3f); + LayoutManager::Instance()->SetPaneDisposalRatio("RIGHT", 0.3f); + LayoutManager::Instance()->SetPaneDisposalRatio("BOTTOM", 0.3f); LayoutManager::Instance()->Init(ICON_NDP2_DESKTOP_MAC " Layouts", "Default Layout"); - LayoutManager::Instance()->AddPane(ConfigPane::Instance(), ICON_NDP2_VIEW_LIST " Config", "", PaneDisposal::LEFT, false, true); - LayoutManager::Instance()->AddPane(UniformsPane::Instance(), ICON_NDP2_TUNE " Tuning", "", PaneDisposal::RIGHT, false, true); - LayoutManager::Instance()->AddPane(TimeLinePane::Instance(), ICON_NDP2_VECTOR_CURVE " TimeLine", "", PaneDisposal::BOTTOM, false, true); - LayoutManager::Instance()->AddPane(ConfigSwitcherPane::Instance(), ICON_NDP2_LAYERS_TRIPLE " Tuning Switcher", "", PaneDisposal::RIGHT, false, false); - LayoutManager::Instance()->AddPane(InfosPane::Instance(), ICON_NDP2_FILE_DOCUMENT_BOX " Notes", "", PaneDisposal::CENTRAL, false, false); + LayoutManager::Instance()->AddPane(ConfigPane::Instance(), ICON_NDP2_VIEW_LIST " Config", "", "LEFT", 0.3f, false, true); + LayoutManager::Instance()->AddPane(UniformsPane::Instance(), ICON_NDP2_TUNE " Tuning", "", "RIGHT", 0.3f, false, true); + LayoutManager::Instance()->AddPane(TimeLinePane::Instance(), ICON_NDP2_VECTOR_CURVE " TimeLine", "", "BOTTOM", 0.3f, false, true); + LayoutManager::Instance()->AddPane(ConfigSwitcherPane::Instance(), ICON_NDP2_LAYERS_TRIPLE " Tuning Switcher", "", "RIGHT", 0.3f, false, false); + LayoutManager::Instance()->AddPane(InfosPane::Instance(), ICON_NDP2_FILE_DOCUMENT_BOX " Notes", "", "CENTRAL", 0.3f, false, false); #ifdef USE_HELP_IN_APP - LayoutManager::Instance()->AddPane(HelpPane::Instance(), ICON_NDP2_COMMENT_QUESTION " Help", "", PaneDisposal::CENTRAL, false, false); + LayoutManager::Instance()->AddPane(HelpPane::Instance(), ICON_NDP2_COMMENT_QUESTION " Help", "", "CENTRAL", 0.3f, false, false); #endif - LayoutManager::Instance()->AddPane(ProfilerPane::Instance(), ICON_NDP2_CLIPBOARD_PULSE " Profiler", "", PaneDisposal::BOTTOM, false, false); - LayoutManager::Instance()->AddPane(ConsolePane::Instance(), ICON_NDP2_COMMENT_TEXT_MULTIPLE " Console", "", PaneDisposal::BOTTOM, false, false); - LayoutManager::Instance()->AddPane(MessagePane::Instance(), ICON_NDP2_COMMENT_TEXT " Message", "", PaneDisposal::CENTRAL, false, false); - LayoutManager::Instance()->AddPane(CodePane::Instance(), ICON_NDP2_FILE_DOCUMENT_EDIT " Code", "", PaneDisposal::LEFT, false, false); + LayoutManager::Instance()->AddPane(ProfilerPane::Instance(), ICON_NDP2_CLIPBOARD_PULSE " Profiler", "", "BOTTOM", 0.3f, false, false); + LayoutManager::Instance()->AddPane(ConsolePane::Instance(), ICON_NDP2_COMMENT_TEXT_MULTIPLE " Console", "", "BOTTOM", 0.3f, false, false); + LayoutManager::Instance()->AddPane(MessagePane::Instance(), ICON_NDP2_COMMENT_TEXT " Message", "", "CENTRAL", 0.3f, false, false); + LayoutManager::Instance()->AddPane(CodePane::Instance(), ICON_NDP2_FILE_DOCUMENT_EDIT " Code", "", "LEFT", 0.3f, false, false); #ifdef _DEBUG - LayoutManager::Instance()->AddPane(InspectorPane::Instance(), ICON_NDP2_ORBIT " Inspector", "", PaneDisposal::BOTTOM, false, false); + LayoutManager::Instance()->AddPane(InspectorPane::Instance(), ICON_NDP2_ORBIT " Inspector", "", "BOTTOM", 0.3f, false, false); #endif - LayoutManager::Instance()->AddPane(BufferPreview::Instance(), ICON_NDP2_VIEW_GRID " Buffers Preview", "", PaneDisposal::RIGHT, false, false); + LayoutManager::Instance()->AddPane(BufferPreview::Instance(), ICON_NDP2_VIEW_GRID " Buffers Preview", "", "RIGHT", 0.3f, false, false); #ifdef USE_VR VRGui::Instance()->SetCodeTree(MainBackend::Instance()->puCodeTree); diff --git a/src/Headers/NoodlesPlateBuild.h b/src/Headers/NoodlesPlateBuild.h index e17964a..5e922c2 100644 --- a/src/Headers/NoodlesPlateBuild.h +++ b/src/Headers/NoodlesPlateBuild.h @@ -1,7 +1,7 @@ #pragma once #define NoodlesPlate_Prefix "NoodlesPlate" -#define NoodlesPlate_BuildNumber 708 +#define NoodlesPlate_BuildNumber 716 #define NoodlesPlate_MinorNumber 7 #define NoodlesPlate_MajorNumber 0 -#define NoodlesPlate_BuildId "0.7.708" +#define NoodlesPlate_BuildId "0.7.716" diff --git a/src/Panes/BufferPreview.cpp b/src/Panes/BufferPreview.cpp index cd4ef46..a233d19 100644 --- a/src/Panes/BufferPreview.cpp +++ b/src/Panes/BufferPreview.cpp @@ -48,7 +48,7 @@ void BufferPreview::Unit() { } bool BufferPreview::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, - const std::string& vUserDatas) { + void* vUserDatas) { if (vInOutPaneShown & paneFlag) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; diff --git a/src/Panes/BufferPreview.h b/src/Panes/BufferPreview.h index b80eb5e..586111d 100644 --- a/src/Panes/BufferPreview.h +++ b/src/Panes/BufferPreview.h @@ -29,7 +29,7 @@ class BufferPreview : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; bool CanWeDisplay() override; // configuration diff --git a/src/Panes/CodePane.cpp b/src/Panes/CodePane.cpp index 91a8731..326b18a 100644 --- a/src/Panes/CodePane.cpp +++ b/src/Panes/CodePane.cpp @@ -48,7 +48,7 @@ void CodePane::Unit() } -bool CodePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool CodePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { if (vInOutPaneShown & paneFlag) { diff --git a/src/Panes/CodePane.h b/src/Panes/CodePane.h index 4ee416e..b6f170e 100644 --- a/src/Panes/CodePane.h +++ b/src/Panes/CodePane.h @@ -26,7 +26,7 @@ class CodePane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; TextEditor* GetEditor(); diff --git a/src/Panes/ConfigPane.cpp b/src/Panes/ConfigPane.cpp index 3a0a716..b5211b2 100644 --- a/src/Panes/ConfigPane.cpp +++ b/src/Panes/ConfigPane.cpp @@ -56,7 +56,7 @@ bool ConfigPane::Init() { void ConfigPane::Unit() { } -bool ConfigPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) { +bool ConfigPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { if (vInOutPaneShown & paneFlag) { static ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_MenuBar; diff --git a/src/Panes/ConfigPane.h b/src/Panes/ConfigPane.h index 3b45ea7..ca1d177 100644 --- a/src/Panes/ConfigPane.h +++ b/src/Panes/ConfigPane.h @@ -27,7 +27,7 @@ class ConfigPane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/ConfigSwitcherPane.cpp b/src/Panes/ConfigSwitcherPane.cpp index 357949a..957ffa1 100644 --- a/src/Panes/ConfigSwitcherPane.cpp +++ b/src/Panes/ConfigSwitcherPane.cpp @@ -50,7 +50,7 @@ void ConfigSwitcherPane::Unit() } -bool ConfigSwitcherPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool ConfigSwitcherPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { if (vInOutPaneShown & paneFlag) { static ImGuiWindowFlags flags = // @@ -95,7 +95,7 @@ bool ConfigSwitcherPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vIn return false; } -bool ConfigSwitcherPane::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool ConfigSwitcherPane::DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr, void* vUserDatas) { ShaderKeyConfigSwitcherUnified::Instance()->DrawDialog(); return false; diff --git a/src/Panes/ConfigSwitcherPane.h b/src/Panes/ConfigSwitcherPane.h index 6bde92e..b55e09a 100644 --- a/src/Panes/ConfigSwitcherPane.h +++ b/src/Panes/ConfigSwitcherPane.h @@ -27,8 +27,8 @@ class ConfigSwitcherPane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; - bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; + bool DrawDialogsAndPopups(const uint32_t& vCurrentFrame, const ImVec2& vMaxSize, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/ConsolePane.cpp b/src/Panes/ConsolePane.cpp index 3cca35f..e266a40 100644 --- a/src/Panes/ConsolePane.cpp +++ b/src/Panes/ConsolePane.cpp @@ -46,7 +46,7 @@ void ConsolePane::Unit() } -bool ConsolePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool ConsolePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { if (vInOutPaneShown & paneFlag) { diff --git a/src/Panes/ConsolePane.h b/src/Panes/ConsolePane.h index d2c52aa..cb2d3c1 100644 --- a/src/Panes/ConsolePane.h +++ b/src/Panes/ConsolePane.h @@ -26,7 +26,7 @@ class ConsolePane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/HelpPane.cpp b/src/Panes/HelpPane.cpp index 0e64f73..f021a6f 100644 --- a/src/Panes/HelpPane.cpp +++ b/src/Panes/HelpPane.cpp @@ -47,7 +47,7 @@ void HelpPane::Unit() } -bool HelpPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool HelpPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { if (vInOutPaneShown & paneFlag) { diff --git a/src/Panes/HelpPane.h b/src/Panes/HelpPane.h index 6b29ea0..b48604e 100644 --- a/src/Panes/HelpPane.h +++ b/src/Panes/HelpPane.h @@ -26,7 +26,7 @@ class HelpPane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/InfosPane.cpp b/src/Panes/InfosPane.cpp index 796744b..ab38a30 100644 --- a/src/Panes/InfosPane.cpp +++ b/src/Panes/InfosPane.cpp @@ -47,7 +47,7 @@ void InfosPane::Unit() } -bool InfosPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool InfosPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { if (vInOutPaneShown & paneFlag) { diff --git a/src/Panes/InfosPane.h b/src/Panes/InfosPane.h index a22c778..b36559a 100644 --- a/src/Panes/InfosPane.h +++ b/src/Panes/InfosPane.h @@ -26,7 +26,7 @@ class InfosPane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/InspectorPane.cpp b/src/Panes/InspectorPane.cpp index 15aecd3..0f1f8ad 100644 --- a/src/Panes/InspectorPane.cpp +++ b/src/Panes/InspectorPane.cpp @@ -132,7 +132,7 @@ inline int DrawBufferChain(RenderPackWeak vRoot, RenderPackWeak vRP, std::set #include #include +#include #include #include #include @@ -61,7 +62,7 @@ void ProfilerPane::Unit() } -bool ProfilerPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool ProfilerPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { iagp::InAppGpuProfiler::Instance()->sIsActive = false; diff --git a/src/Panes/ProfilerPane.h b/src/Panes/ProfilerPane.h index 5a2f3de..d238874 100644 --- a/src/Panes/ProfilerPane.h +++ b/src/Panes/ProfilerPane.h @@ -30,7 +30,7 @@ class ProfilerPane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/TimeLinePane.cpp b/src/Panes/TimeLinePane.cpp index 4689e46..6b09612 100644 --- a/src/Panes/TimeLinePane.cpp +++ b/src/Panes/TimeLinePane.cpp @@ -50,7 +50,7 @@ void TimeLinePane::Unit() } -bool TimeLinePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool TimeLinePane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { TimeLineSystem::Instance()->SetActive(false); diff --git a/src/Panes/TimeLinePane.h b/src/Panes/TimeLinePane.h index cffa176..490f02d 100644 --- a/src/Panes/TimeLinePane.h +++ b/src/Panes/TimeLinePane.h @@ -27,7 +27,7 @@ class TimeLinePane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/UniformsPane.cpp b/src/Panes/UniformsPane.cpp index 91911e7..b8eca6d 100644 --- a/src/Panes/UniformsPane.cpp +++ b/src/Panes/UniformsPane.cpp @@ -51,7 +51,7 @@ void UniformsPane::Unit() } -bool UniformsPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool UniformsPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { if (vInOutPaneShown & paneFlag) { diff --git a/src/Panes/UniformsPane.h b/src/Panes/UniformsPane.h index e96b402..59d5f88 100644 --- a/src/Panes/UniformsPane.h +++ b/src/Panes/UniformsPane.h @@ -29,7 +29,7 @@ class UniformsPane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/Panes/VRPane.cpp b/src/Panes/VRPane.cpp index 881187c..b8533c4 100644 --- a/src/Panes/VRPane.cpp +++ b/src/Panes/VRPane.cpp @@ -48,7 +48,7 @@ void VRPane::Unit() } -bool VRPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, const std::string& vUserDatas) +bool VRPane::DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr, void* vUserDatas) { if (vInOutPaneShown & paneFlag) { diff --git a/src/Panes/VRPane.h b/src/Panes/VRPane.h index 2657f64..ae4ab56 100644 --- a/src/Panes/VRPane.h +++ b/src/Panes/VRPane.h @@ -26,7 +26,7 @@ class VRPane : public AbstractPane, public conf::ConfigAbstract public: bool Init() override; void Unit() override; - bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, const std::string& vUserDatas = {}) override; + bool DrawPanes(const uint32_t& vCurrentFrame, PaneFlags& vInOutPaneShown, ImGuiContext* vContextPtr = nullptr, void* vUserDatas = nullptr) override; // configuration std::string getXml(const std::string& vOffset, const std::string& vUserDatas = "") override; diff --git a/src/main.cpp b/src/main.cpp index b413f60..395d843 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,12 +23,13 @@ #include #include #include +#include #ifdef USE_SDL2 -#include +#include #else -#include +#include #endif -#include +#include #include