diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c50cb29..e637eaae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,6 +129,11 @@ FetchContent_Declare(monado GIT_TAG 79bf8eb8fa168f65f4e5505e0525ee74aa88783e ) +# Use the docking branch of imgui to use multi-viewport +FetchContent_Declare(imgui + GIT_REPOSITORY https://github.com/ocornut/imgui.git + GIT_TAG ce0d0ac8298ce164b5d862577e8b087d92f6e90e + ) add_subdirectory(external) add_subdirectory(common) diff --git a/README.md b/README.md index 71b2e622..e4a0cb71 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,7 @@ Launch No Man's Sky in VR mode on Steam when connection with headset is establis WiVRn uses the following software: - [Avahi](https://www.avahi.org/) - [Boost.PFR](https://github.com/boostorg/pfr) +- [Dear ImGui](https://github.com/ocornut/imgui) - [ffmpeg](https://ffmpeg.org/) optional, for hardware encoding on AMD/Intel - [FreeType](https://freetype.org/) - [glm](http://glm.g-truc.net/) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 2f6d0cda..e8b00d9c 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -5,12 +5,22 @@ set(TINYGLTF_BUILD_BUILDER_EXAMPLE OFF) set(TINYGLTF_HEADER_ONLY OFF) set(TINYGLTF_INSTALL OFF) -FetchContent_MakeAvailable(spdlog glm tinygltf) +FetchContent_MakeAvailable(spdlog glm tinygltf imgui) include(FreetypeHarfbuzz) include(CompileGLSL) include(VulkanVersion) +add_library(imgui OBJECT + ${imgui_SOURCE_DIR}/imgui.cpp + ${imgui_SOURCE_DIR}/imgui_draw.cpp + ${imgui_SOURCE_DIR}/imgui_tables.cpp + ${imgui_SOURCE_DIR}/imgui_widgets.cpp + ${imgui_SOURCE_DIR}/backends/imgui_impl_vulkan.cpp +) + +target_include_directories(imgui PUBLIC ${imgui_SOURCE_DIR}) + if(ANDROID) add_library(wivrn MODULE) @@ -107,7 +117,7 @@ file(GLOB_RECURSE VULKAN_SHADERS CONFIGURE_DEPENDS "*.glsl") target_sources(wivrn PRIVATE ${LOCAL_SOURCE} ${VULKAN_SHADERS}) wivrn_compile_glsl(wivrn ${VULKAN_SHADERS}) -target_link_libraries(wivrn Vulkan::Vulkan spdlog::spdlog glm::glm tinygltf FreetypeHarfbuzz) +target_link_libraries(wivrn Vulkan::Vulkan spdlog::spdlog glm::glm tinygltf FreetypeHarfbuzz imgui) target_compile_definitions(wivrn PRIVATE -DXR_USE_GRAPHICS_API_VULKAN) target_compile_definitions(wivrn PRIVATE -DVMA_STATS_STRING_ENABLED=0) target_compile_options(wivrn PRIVATE -fdiagnostics-color -Wall -Wextra -pedantic) # -Werror