Use SDL for ImGui

This commit is contained in:
SimoneN64
2024-09-17 20:19:59 +02:00
parent 453fa43664
commit 8fe17d0dd7
4 changed files with 19 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ IndentCaseBlocks: true
InsertNewlineAtEOF: true InsertNewlineAtEOF: true
MacroBlockBegin: '' MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
SortIncludes: Never
MaxEmptyLinesToKeep: 2 MaxEmptyLinesToKeep: 2
NamespaceIndentation: Inner NamespaceIndentation: Inner
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: false

10
external/imgui/CMakeLists.txt vendored Normal file
View File

@@ -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)

View File

@@ -36,6 +36,8 @@ include_directories(
../../external/parallel-rdp/parallel-rdp-standalone/util ../../external/parallel-rdp/parallel-rdp-standalone/util
../../external/unarr ../../external/unarr
../../external/SDL/include ../../external/SDL/include
../../external/imgui
../../external/imgui/backends
) )
option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." OFF) option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." OFF)

View File

@@ -6,6 +6,12 @@
#include <QWidget> #include <QWidget>
#include <QWindow> #include <QWindow>
#include <imgui.h>
#include <imgui_impl_sdl3.h>
#include <imgui_impl_vulkan.h>
#include <SDL3/SDL.h>
#include <SDL3/SDL_vulkan.h>
struct QtInstanceFactory : Vulkan::InstanceFactory { struct QtInstanceFactory : Vulkan::InstanceFactory {
VkInstance create_instance(const VkInstanceCreateInfo *info) override { VkInstance create_instance(const VkInstanceCreateInfo *info) override {
qVkInstance.setApiVersion({1, 3, 0}); qVkInstance.setApiVersion({1, 3, 0});