diff --git a/src/spice2x/CMakeLists.txt b/src/spice2x/CMakeLists.txt index 9b395c5..de4af6c 100644 --- a/src/spice2x/CMakeLists.txt +++ b/src/spice2x/CMakeLists.txt @@ -211,7 +211,7 @@ add_compile_definitions( #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DACIOEMU_LOG") # add project directory to include path so we can comfortably import -include_directories(${spicetools_SOURCE_DIR}) +include_directories(${spicetools_SOURCE_DIR} ${spicetools_SOURCE_DIR}/external/imgui) # add external libraries add_subdirectory(external/fmt EXCLUDE_FROM_ALL) @@ -516,7 +516,6 @@ set(SOURCE_FILES ${SOURCE_FILES} overlay/overlay.cpp overlay/window.cpp overlay/imgui/extensions.cpp - overlay/imgui/impl_dx9.cpp overlay/imgui/impl_spice.cpp overlay/imgui/impl_sw.cpp overlay/windows/acio_status_buffers.cpp diff --git a/src/spice2x/external/imgui/CMakeLists.txt b/src/spice2x/external/imgui/CMakeLists.txt index 66dae4c..a66e9b7 100644 --- a/src/spice2x/external/imgui/CMakeLists.txt +++ b/src/spice2x/external/imgui/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.12) project(imgui CXX) # dear imgui uses the C++ virtual interfaces for DirectX @@ -8,7 +8,8 @@ set(IMGUI_HEADERS imconfig.h imgui.h imgui_internal.h - imgui_stdlib.h + backends/imgui_impl_dx9.h + misc/cpp/imgui_stdlib.h ) set(IMGUI_SOURCES imgui.cpp @@ -16,7 +17,8 @@ set(IMGUI_SOURCES imgui_tables.cpp imgui_widgets.cpp imgui_demo.cpp - imgui_stdlib.cpp + backends/imgui_impl_dx9.cpp + misc/cpp/imgui_stdlib.cpp ) add_library(imgui STATIC ${IMGUI_HEADERS} ${IMGUI_SOURCES}) diff --git a/src/spice2x/overlay/imgui/impl_dx9.cpp b/src/spice2x/external/imgui/backends/imgui_impl_dx9.cpp similarity index 99% rename from src/spice2x/overlay/imgui/impl_dx9.cpp rename to src/spice2x/external/imgui/backends/imgui_impl_dx9.cpp index 8d04e04..d193a92 100644 --- a/src/spice2x/overlay/imgui/impl_dx9.cpp +++ b/src/spice2x/external/imgui/backends/imgui_impl_dx9.cpp @@ -22,14 +22,14 @@ // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplDX9_RenderDrawData() in the .h file so you can call it yourself. // 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves. -#include "impl_dx9.h" +#include "imgui_impl_dx9.h" #include // DirectX #include -#include "external/imgui/imgui.h" +#include "imgui.h" // allow std::min use #ifdef min diff --git a/src/spice2x/overlay/imgui/impl_dx9.h b/src/spice2x/external/imgui/backends/imgui_impl_dx9.h similarity index 96% rename from src/spice2x/overlay/imgui/impl_dx9.h rename to src/spice2x/external/imgui/backends/imgui_impl_dx9.h index dff6431..90f60c2 100644 --- a/src/spice2x/overlay/imgui/impl_dx9.h +++ b/src/spice2x/external/imgui/backends/imgui_impl_dx9.h @@ -11,7 +11,7 @@ #pragma once -#include "external/imgui/imgui.h" +#include "imgui.h" struct IDirect3DDevice9; diff --git a/src/spice2x/external/imgui/imgui_stdlib.cpp b/src/spice2x/external/imgui/misc/cpp/imgui_stdlib.cpp similarity index 100% rename from src/spice2x/external/imgui/imgui_stdlib.cpp rename to src/spice2x/external/imgui/misc/cpp/imgui_stdlib.cpp diff --git a/src/spice2x/external/imgui/imgui_stdlib.h b/src/spice2x/external/imgui/misc/cpp/imgui_stdlib.h similarity index 100% rename from src/spice2x/external/imgui/imgui_stdlib.h rename to src/spice2x/external/imgui/misc/cpp/imgui_stdlib.h diff --git a/src/spice2x/overlay/imgui/impl_spice.cpp b/src/spice2x/overlay/imgui/impl_spice.cpp index 2d2dd18..74134a2 100644 --- a/src/spice2x/overlay/imgui/impl_spice.cpp +++ b/src/spice2x/overlay/imgui/impl_spice.cpp @@ -13,6 +13,14 @@ #include "util/logging.h" #include "util/utils.h" +#if !defined(IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS) || \ + !defined(IMGUI_DISABLE_DEFAULT_ALLOCATORS) || \ + !defined(IMGUI_USE_BGRA_PACKED_COLOR) || \ + !defined(IMGUI_HAS_VIEWPORT) || \ + !defined(IMGUI_HAS_DOCK) +#error "fix imconfig.h after updating imgui version" +#endif + // state static HWND g_hWnd = nullptr; static INT64 g_Time = 0; diff --git a/src/spice2x/overlay/overlay.cpp b/src/spice2x/overlay/overlay.cpp index 5718b1c..7597684 100644 --- a/src/spice2x/overlay/overlay.cpp +++ b/src/spice2x/overlay/overlay.cpp @@ -11,10 +11,7 @@ #include "util/resutils.h" #include "build/resource.h" -#include "imgui/impl_dx9.h" -#include "imgui/impl_spice.h" -#include "imgui/impl_sw.h" -#include "overlay/imgui/impl_dx9.h" +#include "external/imgui/backends/imgui_impl_dx9.h" #include "overlay/imgui/impl_spice.h" #include "overlay/imgui/impl_sw.h" diff --git a/src/spice2x/overlay/window.h b/src/spice2x/overlay/window.h index 07ae0ef..b7124ec 100644 --- a/src/spice2x/overlay/window.h +++ b/src/spice2x/overlay/window.h @@ -3,7 +3,7 @@ #include #include "external/imgui/imgui.h" -#include "external/imgui/imgui_stdlib.h" +#include "external/imgui/misc/cpp/imgui_stdlib.h" #include "overlay.h" namespace overlay {