Merge pull request #10375 from Pokechu22/imgui-assert

Externals: Use Common ASSERT for IM_ASSERT
This commit is contained in:
Admiral H. Curtiss 2022-03-26 05:53:59 +01:00 committed by GitHub
commit 379de5de15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 3 deletions

View file

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

1
Externals/imgui/README.txt vendored Normal file
View file

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

View file

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

View file

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