Externals: Make imgui a submodule

This commit is contained in:
Joshua Vandaële
2025-10-30 15:02:19 +01:00
parent b920182c97
commit 7960a306f7
23 changed files with 45 additions and 65867 deletions
+4
View File
@@ -126,3 +126,7 @@
path = Externals/bzip2/bzip2
url = https://gitlab.com/bzip2/bzip2.git
shallow = true
[submodule "Externals/imgui/imgui"]
path = Externals/imgui/imgui
url = https://github.com/ocornut/imgui.git
shallow = true
+16 -6
View File
@@ -5,16 +5,26 @@ if (NOT MSVC)
endif()
set(SRCS
imgui.cpp
imgui_demo.cpp
imgui_draw.cpp
imgui_tables.cpp
imgui_widgets.cpp
imgui/imgui.cpp
imgui/imgui_demo.cpp
imgui/imgui_draw.cpp
imgui/imgui_tables.cpp
imgui/imgui_widgets.cpp
)
add_library(imgui STATIC ${SRCS})
dolphin_disable_warnings(imgui)
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories(imgui
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/imgui"
)
target_compile_definitions(imgui
PUBLIC
IMGUI_USER_CONFIG="imgui_user_config.h"
)
target_link_libraries(imgui
PRIVATE
-21
View File
@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014-2025 Omar Cornut
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-1
View File
@@ -1 +0,0 @@
When updating, make sure to preserve changes to imconfig.h. Dolphin modifies it to use a custom assertion handler and to tweak settings.
+2 -1
View File
@@ -2,7 +2,8 @@
<Project>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ExternalsDir)imgui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ExternalsDir)imgui;$(ExternalsDir)imgui\imgui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>IMGUI_USER_CONFIG="imgui_user_config.h";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
-219
View File
@@ -1,219 +0,0 @@
//-----------------------------------------------------------------------------
// DEAR IMGUI COMPILE-TIME OPTIONS
// Runtime options (clipboard callbacks, enabling various features, etc.) can
// generally be set via the ImGuiIO structure. You can use
// ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to
// rewire memory allocation functions.
//-----------------------------------------------------------------------------
// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or
// maintain a patch/rebased branch with your modifications to it) B) or '#define
// IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add
// directives in your own file without touching this template.
//-----------------------------------------------------------------------------
// You need to make sure that configuration settings are defined consistently
// _everywhere_ Dear ImGui is used, which include the imgui*.cpp files but also
// _any_ of your code that uses Dear ImGui. This is because some compile-time
// options have an affect on data structures. Defining those options in
// imconfig.h will ensure every compilation unit gets to see the same data
// structure layouts. Call IMGUI_CHECKVERSION() from your .cpp file to verify
// that the data structures your files are using are matching the ones imgui.cpp
// is using.
//-----------------------------------------------------------------------------
#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) ASSERT(_EXPR)
// #define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
//---- 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.
// - Windows DLL users: heaps and globals are not shared across DLL boundaries!
// You will need to call SetCurrentContext() + SetAllocatorFunctions()
// for each static/DLL boundary you are calling from. Read "Context and Memory
// Allocators" section of imgui.cpp for more details.
// #define IMGUI_API __declspec(dllexport) // MSVC Windows:
// DLL export #define IMGUI_API __declspec(dllimport) // MSVC
// Windows: DLL import #define IMGUI_API __attribute__((visibility("default")))
// // GCC/Clang: override visibility when set is hidden
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from
// time to time after updating to clean your code of obsolete function/names.
// #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
// It is very strongly recommended to NOT disable the demo windows and debug
// tool during development. They are extremely useful in day to day work. Please
// read comments in imgui_demo.cpp.
// #define IMGUI_DISABLE // Disable
// everything: all headers and source files will be empty.
#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows:
// ShowDemoWindow()/ShowStyleEditor() will be
// empty.
// #define IMGUI_DISABLE_DEBUG_TOOLS // Disable
// metrics/debugger and other debug tools: ShowMetricsWindow(),
// ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.
//---- Don't implement some functions to reduce linkage requirements.
// #define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't
// implement default clipboard handler. Won't use and link with
// OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a,
// kernel32.lib/.a) #define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS //
// [Win32] [Default with Visual Studio] Implement default IME handler (require
// imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
// #define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default
// with non-Visual Studio compilers] Don't implement default IME handler (won't
// require imm32.lib/.a) #define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't
// use and link with any Win32 function (clipboard, IME). #define
// IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default
// OSX clipboard handler (need to link with '-framework ApplicationServices',
// this is why this is not the default). #define
// IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default
// platform_io.Platform_OpenInShellFn() handler (Win32: ShellExecute(), require
// shell32.lib/.a, Mac/Linux: use system("")). #define
// IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement
// ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if
// you don't want to link with vsnprintf) #define
// IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement
// ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement
// them yourself. #define IMGUI_DISABLE_FILE_FUNCTIONS //
// Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and
// ImFileHandle at all (replace them with dummies) #define
// IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement
// ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can
// implement them yourself if you don't want to link with
// fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
// #define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement
// default allocators calling malloc()/free() to avoid linking with them. You
// will need to call ImGui::SetAllocatorFunctions(). #define
// IMGUI_DISABLE_DEFAULT_FONT // Disable default embedded
// font (ProggyClean.ttf), remove ~9.5 KB from output binary. AddFontDefault()
// will assert. #define IMGUI_DISABLE_SSE //
// Disable use of SSE intrinsics even if available
//---- Enable Test Engine / Automation features.
// #define IMGUI_ENABLE_TEST_ENGINE // Enable
// imgui_test_engine hooks. Generally set automatically by include
// "imgui_te_config.h", see Test Engine for details.
//---- Include imgui_user.h at the end of imgui.h as a convenience
// May be convenient for some users to only explicitly include vanilla imgui.h
// and have extra stuff included.
// #define IMGUI_INCLUDE_IMGUI_USER_H
// #define IMGUI_USER_H_FILENAME "my_folder/my_imgui_user.h"
//---- Pack vertex colors as BGRA8 instead of RGBA8 (to avoid converting from
// one to another). Need dedicated backend support. #define
// IMGUI_USE_BGRA_PACKED_COLOR
//---- Use legacy CRC32-adler tables (used before 1.91.6), in order to preserve
// old .ini data that you cannot afford to invalidate. #define
// IMGUI_USE_LEGACY_CRC32_ADLER
//---- Use 32-bit for ImWchar (default is 16-bit) to support Unicode planes
// 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes,
// ancient languages, etc...) #define IMGUI_USE_WCHAR32
//---- Avoid multiple STB libraries implementations, or redefine path/filenames
// to prioritize another version
// By default the embedded implementations are declared static and not available
// outside of Dear ImGui sources files.
// #define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
// #define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
// #define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only
// used if IMGUI_USE_STB_SPRINTF is defined. #define
// IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION #define
// IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION #define
// IMGUI_DISABLE_STB_SPRINTF_IMPLEMENTATION // only disabled
// if IMGUI_USE_STB_SPRINTF is defined.
//---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the
// one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
// Compatibility checks of arguments and formats done by clang and GCC will be
// disabled in order to support the extra formats provided by stb_sprintf.h.
// #define IMGUI_USE_STB_SPRINTF
//---- Use FreeType to build and rasterize the font atlas (instead of
// stb_truetype which is embedded by default in Dear ImGui)
// Requires FreeType headers to be available in the include path. Requires
// program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this
// repository) + the FreeType library (not provided). On Windows you may use
// vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate
// install'.
// #define IMGUI_ENABLE_FREETYPE
//---- Use FreeType + plutosvg or lunasvg to render OpenType SVG fonts (SVGinOT)
// Only works in combination with IMGUI_ENABLE_FREETYPE.
// - plutosvg is currently easier to install, as e.g. it is part of vcpkg. It
// will support more fonts and may load them faster. See misc/freetype/README
// for instructions.
// - Both require headers to be available in the include path + program to be
// linked with the library code (not provided).
// - (note: lunasvg implementation is based on Freetype's rsvg-port.c which is
// licensed under CeCILL-C Free Software License Agreement)
// #define IMGUI_ENABLE_FREETYPE_PLUTOSVG
// #define IMGUI_ENABLE_FREETYPE_LUNASVG
//---- Use stb_truetype to build and rasterize the font atlas (default)
// The only purpose of this define is if you want force compilation of the
// stb_truetype backend ALONG with the FreeType backend.
// #define IMGUI_ENABLE_STB_TRUETYPE
//---- Define constructor and implicit cast operators to convert back<>forth
// between your math types and ImVec2/ImVec4.
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
/*
#define IM_VEC2_CLASS_EXTRA \
constexpr ImVec2(const MyVec2& f) : x(f.x), y(f.y) {} \ operator
MyVec2() const { return MyVec2(x,y); }
#define IM_VEC4_CLASS_EXTRA \
constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \
operator MyVec4() const { return MyVec4(x,y,z,w); }
*/
//---- ...Or use Dear ImGui's own very basic math operators.
// #define IMGUI_DEFINE_MATH_OPERATORS
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large
// meshes with more than 64K vertices.
// Your renderer backend will need to support it (most example renderer backends
// support both 16/32-bit indices). Another way to allow large meshes while
// keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
// #define ImDrawIdx unsigned int
//---- Override ImDrawCallback signature (will need to modify renderer backends
// accordingly) struct ImDrawList; struct ImDrawCmd; typedef void
// (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void*
// my_renderer_user_data); #define ImDrawCallback MyImDrawCallback
//---- Debug Tools: Macro to break in Debugger (we provide a default
// implementation of this in the codebase)
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break
// into them for easy debugging.)
// #define IM_DEBUG_BREAK IM_ASSERT(0)
// #define IM_DEBUG_BREAK __debugbreak()
//---- Debug Tools: Enable highlight ID conflicts _before_ hovering items. When
// io.ConfigDebugHighlightIdConflicts is set.
// (THIS WILL SLOW DOWN DEAR IMGUI. Only use occasionally and disable after use)
// #define IMGUI_DEBUG_HIGHLIGHT_ALL_ID_CONFLICTS
//---- Debug Tools: Enable slower asserts
// #define IMGUI_DEBUG_PARANOID
//---- Tip: You can add extra functions within the ImGui:: namespace from
// anywhere (e.g. your own sources/header files)
/*
namespace ImGui
{
void MyFunction(const char* name, MyMatrix44* mtx);
}
*/
Vendored Submodule
+1
Submodule Externals/imgui/imgui added at 45acd5e0e8
-17877
View File
File diff suppressed because it is too large Load Diff
-4135
View File
File diff suppressed because it is too large Load Diff
+15 -14
View File
@@ -18,25 +18,26 @@
<ItemDefinitionGroup>
<ClCompile>
<!--IM_ASSERT is defined as Dolphin's ASSERT() :( (DolphinLib circular dependency)-->
<AdditionalIncludeDirectories>.;$(CoreDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>.;imgui;$(CoreDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>IMGUI_USER_CONFIG="imgui_user_config.h";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="imgui.cpp" />
<ClCompile Include="imgui_demo.cpp" />
<ClCompile Include="imgui_draw.cpp" />
<ClCompile Include="imgui_tables.cpp" />
<ClCompile Include="imgui_widgets.cpp" />
<ClCompile Include="misc/cpp/imgui_stdlib.cpp" />
<ClCompile Include="imgui/imgui.cpp" />
<ClCompile Include="imgui/imgui_demo.cpp" />
<ClCompile Include="imgui/imgui_draw.cpp" />
<ClCompile Include="imgui/imgui_tables.cpp" />
<ClCompile Include="imgui/imgui_widgets.cpp" />
<ClCompile Include="imgui/misc/cpp/imgui_stdlib.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="imconfig.h" />
<ClInclude Include="imgui.h" />
<ClInclude Include="imgui_internal.h" />
<ClInclude Include="imstb_rectpack.h" />
<ClInclude Include="imstb_textedit.h" />
<ClInclude Include="imstb_truetype.h" />
<ClInclude Include="misc/cpp/imgui_stdlib.h" />
<ClInclude Include="imgui_user_config.h" />
<ClInclude Include="imgui/imgui.h" />
<ClInclude Include="imgui/imgui_internal.h" />
<ClInclude Include="imgui/imstb_rectpack.h" />
<ClInclude Include="imgui/imstb_textedit.h" />
<ClInclude Include="imgui/imstb_truetype.h" />
<ClInclude Include="imgui/misc/cpp/imgui_stdlib.h" />
</ItemGroup>
<Import Project="$(ExternalsDir)fmt\exports.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-10837
View File
File diff suppressed because it is too large Load Diff
-6304
View File
File diff suppressed because it is too large Load Diff
-3909
View File
File diff suppressed because it is too large Load Diff
-4562
View File
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
#pragma once
#include "Common/Assert.h"
#define IM_ASSERT(_EXPR) ASSERT(_EXPR)
#define IMGUI_DISABLE_DEMO_WINDOWS
-10632
View File
File diff suppressed because it is too large Load Diff
-627
View File
File diff suppressed because it is too large Load Diff
-1488
View File
File diff suppressed because it is too large Load Diff
-5085
View File
File diff suppressed because it is too large Load Diff
-23
View File
@@ -1,23 +0,0 @@
misc/cpp/
InputText() wrappers for C++ standard library (STL) type: std::string.
This is also an example of how you may wrap your own similar types.
misc/debuggers/
Helper files for popular debuggers.
With the .natvis file, types like ImVector<> will be displayed nicely in Visual Studio debugger.
misc/fonts/
Fonts loading/merging instructions (e.g. How to handle glyph ranges, how to merge icons fonts).
Command line tool "binary_to_compressed_c" to create compressed arrays to embed data in source code.
Suggested fonts and links.
misc/freetype/
Font atlas builder/rasterizer using FreeType instead of stb_truetype.
Benefit from better FreeType rasterization, in particular for small fonts.
misc/single_file/
Single-file header stub.
We use this to validate compiling all *.cpp files in a same compilation unit.
Users of that technique (also called "Unity builds") can generally provide this themselves,
so we don't really recommend you use this in your projects.

Some files were not shown because too many files have changed in this diff Show More