diff --git a/Externals/imgui/CMakeLists.txt b/Externals/imgui/CMakeLists.txt index e3c3c8c99f..b3d48432a1 100644 --- a/Externals/imgui/CMakeLists.txt +++ b/Externals/imgui/CMakeLists.txt @@ -1,3 +1,7 @@ +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + set(SRCS imgui.cpp imgui_draw.cpp @@ -8,3 +12,8 @@ set(SRCS add_library(imgui STATIC ${SRCS}) target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") +target_link_libraries(imgui +PRIVATE + common + fmt::fmt +) diff --git a/Externals/imgui/README.txt b/Externals/imgui/README.txt new file mode 100644 index 0000000000..0380b1f3b8 --- /dev/null +++ b/Externals/imgui/README.txt @@ -0,0 +1 @@ +When updating, make sure to preserve changes to imconfig.h. Dolphin modifies it to use a custom assertion handler and to tweak settings. diff --git a/Externals/imgui/imconfig.h b/Externals/imgui/imconfig.h index 7082c55075..5cdc92ecaa 100644 --- a/Externals/imgui/imconfig.h +++ b/Externals/imgui/imconfig.h @@ -14,10 +14,11 @@ #pragma once +#include "Common/Assert.h" + //---- Define assertion handler. Defaults to calling assert(). // If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement. -//#define IM_ASSERT(_EXPR) MyAssert(_EXPR) -//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts +#define IM_ASSERT(_EXPR) ASSERT(_EXPR) //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows // Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility. @@ -27,7 +28,7 @@ //#define IMGUI_API __declspec( dllimport ) //---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names. -//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS +#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS //---- Disable all of Dear ImGui or don't implement standard windows. // It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp. diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index bdd585135b..861c69d985 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -971,6 +971,11 @@ void Renderer::RecordVideoMemory() bool Renderer::InitializeImGui() { + if (!IMGUI_CHECKVERSION()) + { + PanicAlertFmt("ImGui version check failed"); + return false; + } if (!ImGui::CreateContext()) { PanicAlertFmt("Creating ImGui context failed");