From 8fe17d0dd763e9d81836b122906a1a95f9d97e4a Mon Sep 17 00:00:00 2001 From: SimoneN64 Date: Tue, 17 Sep 2024 20:19:59 +0200 Subject: [PATCH] Use SDL for ImGui --- .clang-format | 1 + external/imgui/CMakeLists.txt | 10 ++++++++++ src/frontend/CMakeLists.txt | 2 ++ src/frontend/RenderWidget.hpp | 6 ++++++ 4 files changed, 19 insertions(+) create mode 100644 external/imgui/CMakeLists.txt diff --git a/.clang-format b/.clang-format index 1802970d..290b0e98 100644 --- a/.clang-format +++ b/.clang-format @@ -41,6 +41,7 @@ IndentCaseBlocks: true InsertNewlineAtEOF: true MacroBlockBegin: '' MacroBlockEnd: '' +SortIncludes: Never MaxEmptyLinesToKeep: 2 NamespaceIndentation: Inner SpaceInEmptyParentheses: false diff --git a/external/imgui/CMakeLists.txt b/external/imgui/CMakeLists.txt new file mode 100644 index 00000000..c0ed3633 --- /dev/null +++ b/external/imgui/CMakeLists.txt @@ -0,0 +1,10 @@ +project(imgui) + +file(GLOB SOURCES *.cpp) +file(GLOB HEADERS *.h) + +list(APPEND SOURCES backends/imgui_impl_sdl3.cpp backends/imgui_impl_vulkan.cpp) + +add_library(imgui ${SOURCES} ${HEADERS}) +target_include_directories(imgui PRIVATE . backends ../SDL/include) +target_compile_definitions(imgui PUBLIC IMGUI_IMPL_VULKAN_USE_VOLK) \ No newline at end of file diff --git a/src/frontend/CMakeLists.txt b/src/frontend/CMakeLists.txt index 29f6821e..972b97d8 100644 --- a/src/frontend/CMakeLists.txt +++ b/src/frontend/CMakeLists.txt @@ -36,6 +36,8 @@ include_directories( ../../external/parallel-rdp/parallel-rdp-standalone/util ../../external/unarr ../../external/SDL/include + ../../external/imgui + ../../external/imgui/backends ) option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." OFF) diff --git a/src/frontend/RenderWidget.hpp b/src/frontend/RenderWidget.hpp index 978a1b2e..a7d508f9 100644 --- a/src/frontend/RenderWidget.hpp +++ b/src/frontend/RenderWidget.hpp @@ -6,6 +6,12 @@ #include #include +#include +#include +#include +#include +#include + struct QtInstanceFactory : Vulkan::InstanceFactory { VkInstance create_instance(const VkInstanceCreateInfo *info) override { qVkInstance.setApiVersion({1, 3, 0});