diff --color -rbu ./backends/imgui_impl_opengl3.cpp ../scummvm/scummvm/backends/imgui/backends/imgui_impl_opengl3.cpp --- ./backends/imgui_impl_opengl3.cpp 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_opengl3.cpp 2025-06-29 23:57:31 @@ -119,7 +119,7 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "imgui.h" +#include "backends/imgui/imgui.h" #ifndef IMGUI_DISABLE #include "imgui_impl_opengl3.h" #include @@ -174,6 +174,7 @@ // Typically you would run: python3 ./gl3w_gen.py --output ../imgui/backends/imgui_impl_opengl3_loader.h --ref ../imgui/backends/imgui_impl_opengl3.cpp ./extra_symbols.txt // - You can temporarily use an unstripped version. See https://github.com/dearimgui/gl3w_stripped/releases // Changes to this backend using new APIs should be accompanied by a regenerated stripped loader version. +#define IMGL3W_SCUMMVM_LOADER #define IMGL3W_IMPL #define IMGUI_IMPL_OPENGL_LOADER_IMGL3W #include "imgui_impl_opengl3_loader.h" diff --color -rbu ./backends/imgui_impl_opengl3.h ../scummvm/scummvm/backends/imgui/backends/imgui_impl_opengl3.h --- ./backends/imgui_impl_opengl3.h 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_opengl3.h 2025-06-29 23:57:31 @@ -28,7 +28,7 @@ // Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp. #pragma once -#include "imgui.h" // IMGUI_IMPL_API +#include "backends/imgui/imgui.h" // IMGUI_IMPL_API #ifndef IMGUI_DISABLE // Follow "Getting Started" link and check examples/ folder to learn about using backends! @@ -58,7 +58,7 @@ #endif #if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__)) #define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es" -#elif defined(__EMSCRIPTEN__) || defined(__amigaos4__) +#elif defined(__EMSCRIPTEN__) #define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100" #else // Otherwise imgui_impl_opengl3_loader.h will be used. diff --color -rbu ./backends/imgui_impl_opengl3_loader.h ../scummvm/scummvm/backends/imgui/backends/imgui_impl_opengl3_loader.h --- ./backends/imgui_impl_opengl3_loader.h 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_opengl3_loader.h 2025-06-29 23:57:31 @@ -56,6 +56,11 @@ #ifndef __gl3w_h_ #define __gl3w_h_ +#if defined(IMGL3W_SCUMMVM_LOADER) +#define FORBIDDEN_SYMBOL_ALLOW_ALL +#include "common/system.h" +#endif + // Adapted from KHR/khrplatform.h to avoid including entire file. #ifndef __khrplatform_h_ typedef float khronos_float_t; @@ -625,7 +630,20 @@ #define GL3W_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#if defined(_WIN32) +#if defined(IMGL3W_SCUMMVM_LOADER) +static int open_libgl(void) +{ + return GL3W_OK; +} + +static void close_libgl(void) { } + +static GL3WglProc get_proc(const char *proc) +{ + return (GL3WglProc)g_system->getOpenGLProcAddress(proc); +} + +#elif defined(_WIN32) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif diff --color -rbu ./backends/imgui_impl_sdl2.cpp ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdl2.cpp --- ./backends/imgui_impl_sdl2.cpp 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdl2.cpp 2025-06-29 23:57:31 @@ -106,9 +106,11 @@ // 2017-08-25: Inputs: MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1). // 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers. -#include "imgui.h" +#include "backends/imgui/imgui.h" #ifndef IMGUI_DISABLE +#include "backends/platform/sdl/sdl.h" #include "imgui_impl_sdl2.h" +#if SDL_VERSION_ATLEAST(2, 0, 0) // Clang warnings with -Weverything #if defined(__clang__) @@ -383,6 +385,11 @@ return ImGui::FindViewportByPlatformHandle((void*)(intptr_t)window_id); } +bool ImGui_ImplSDL2_Ready() +{ + return ImGui_ImplSDL2_GetBackendData() != nullptr; +} + // You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs. // - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application, or clear/overwrite your copy of the mouse data. // - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or clear/overwrite your copy of the keyboard data. @@ -1301,4 +1308,5 @@ #pragma clang diagnostic pop #endif +#endif #endif // #ifndef IMGUI_DISABLE diff --color -rbu ./backends/imgui_impl_sdl2.h ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdl2.h --- ./backends/imgui_impl_sdl2.h 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdl2.h 2025-06-29 23:57:31 @@ -23,7 +23,7 @@ // - Introduction, links and more at the top of imgui.cpp #pragma once -#include "imgui.h" // IMGUI_IMPL_API +#include "backends/imgui/imgui.h" // IMGUI_IMPL_API #ifndef IMGUI_DISABLE struct SDL_Window; @@ -41,6 +41,7 @@ IMGUI_IMPL_API void ImGui_ImplSDL2_Shutdown(); IMGUI_IMPL_API void ImGui_ImplSDL2_NewFrame(); IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event); +IMGUI_IMPL_API bool ImGui_ImplSDL2_Ready(); // DPI-related helpers (optional) IMGUI_IMPL_API float ImGui_ImplSDL2_GetContentScaleForWindow(SDL_Window* window); diff --color -rbu ./backends/imgui_impl_sdl3.cpp ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdl3.cpp --- ./backends/imgui_impl_sdl3.cpp 2025-06-29 15:22:31 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdl3.cpp 2025-06-29 23:57:31 @@ -67,8 +67,9 @@ // 2023-02-23: Accept SDL_GetPerformanceCounter() not returning a monotonically increasing value. (#6189, #6114, #3644) // 2023-02-07: Forked "imgui_impl_sdl2" into "imgui_impl_sdl3". Removed version checks for old feature. Refer to imgui_impl_sdl2.cpp for older changelog. -#include "imgui.h" +#include "backends/imgui/imgui.h" #ifndef IMGUI_DISABLE +#include "backends/platform/sdl/sdl.h" #include "imgui_impl_sdl3.h" // Clang warnings with -Weverything diff --color -rbu ./backends/imgui_impl_sdl3.h ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdl3.h --- ./backends/imgui_impl_sdl3.h 2025-04-11 13:16:16 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdl3.h 2025-06-29 23:57:31 @@ -22,7 +22,7 @@ // - Introduction, links and more at the top of imgui.cpp #pragma once -#include "imgui.h" // IMGUI_IMPL_API +#include "backends/imgui/imgui.h" // IMGUI_IMPL_API #ifndef IMGUI_DISABLE struct SDL_Window; diff --color -rbu ./backends/imgui_impl_sdlrenderer2.cpp ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdlrenderer2.cpp --- ./backends/imgui_impl_sdlrenderer2.cpp 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdlrenderer2.cpp 2025-06-29 23:57:31 @@ -37,7 +37,7 @@ // 2021-10-06: Backup and restore modified ClipRect/Viewport. // 2021-09-21: Initial version. -#include "imgui.h" +#include "backends/imgui/imgui.h" #ifndef IMGUI_DISABLE #include "imgui_impl_sdlrenderer2.h" #include // intptr_t diff --color -rbu ./backends/imgui_impl_sdlrenderer2.h ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdlrenderer2.h --- ./backends/imgui_impl_sdlrenderer2.h 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdlrenderer2.h 2025-06-29 23:57:31 @@ -26,8 +26,8 @@ // - Introduction, links and more at the top of imgui.cpp #pragma once +#include "backends/imgui/imgui.h" // IMGUI_IMPL_API #ifndef IMGUI_DISABLE -#include "imgui.h" // IMGUI_IMPL_API struct SDL_Renderer; diff --color -rbu ./backends/imgui_impl_sdlrenderer3.cpp ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdlrenderer3.cpp --- ./backends/imgui_impl_sdlrenderer3.cpp 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdlrenderer3.cpp 2025-06-29 23:57:31 @@ -34,7 +34,7 @@ // 2024-02-12: Amend to query SDL_RenderViewportSet() and restore viewport accordingly. // 2023-05-30: Initial version. -#include "imgui.h" +#include "backends/imgui/imgui.h" #ifndef IMGUI_DISABLE #include "imgui_impl_sdlrenderer3.h" #include // intptr_t diff --color -rbu ./backends/imgui_impl_sdlrenderer3.h ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdlrenderer3.h --- ./backends/imgui_impl_sdlrenderer3.h 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/backends/imgui_impl_sdlrenderer3.h 2025-06-29 23:57:31 @@ -26,7 +26,7 @@ // - Introduction, links and more at the top of imgui.cpp #pragma once -#include "imgui.h" // IMGUI_IMPL_API +#include "backends/imgui/imgui.h" // IMGUI_IMPL_API #ifndef IMGUI_DISABLE struct SDL_Renderer; diff --color -rbu ./imconfig.h ../scummvm/scummvm/backends/imgui/imconfig.h --- ./imconfig.h 2025-02-20 22:00:35 +++ ../scummvm/scummvm/backends/imgui/imconfig.h 2025-06-29 23:57:31 @@ -42,7 +42,7 @@ //#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_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) diff --color -rbu ./imgui.cpp ../scummvm/scummvm/backends/imgui/imgui.cpp --- ./imgui.cpp 2025-06-29 15:22:31 +++ ../scummvm/scummvm/backends/imgui/imgui.cpp 2025-06-29 23:57:31 @@ -15881,7 +15881,7 @@ line_end[-1] = 0; const char* name_end = line_end - 1; const char* type_start = line + 1; - char* type_end = (char*)(void*)ImStrchrRange(type_start, name_end, ']'); + char* type_end = const_cast(ImStrchrRange(type_start, name_end, ']')); const char* name_start = type_end ? ImStrchrRange(type_end + 1, name_end, '[') : NULL; if (!type_end || !name_start) continue; @@ -22199,7 +22199,7 @@ if (TreeNode("SettingsIniData", "Settings unpacked data (.ini): %d bytes", g.SettingsIniData.size())) { - InputTextMultiline("##Ini", (char*)(void*)g.SettingsIniData.c_str(), g.SettingsIniData.Buf.Size, ImVec2(-FLT_MIN, GetTextLineHeight() * 20), ImGuiInputTextFlags_ReadOnly); + InputTextMultiline("##Ini", const_cast(g.SettingsIniData.c_str()), g.SettingsIniData.Buf.Size, ImVec2(-FLT_MIN, GetTextLineHeight() * 20), ImGuiInputTextFlags_ReadOnly); TreePop(); } TreePop(); diff --color -rbu ./imgui.h ../scummvm/scummvm/backends/imgui/imgui.h --- ./imgui.h 2025-06-29 15:22:31 +++ ../scummvm/scummvm/backends/imgui/imgui.h 2025-06-29 23:57:31 @@ -108,8 +108,10 @@ #define IM_FMTARGS(FMT) __attribute__((format(gnu_printf, FMT, FMT+1))) #define IM_FMTLIST(FMT) __attribute__((format(gnu_printf, FMT, 0))) #elif !defined(IMGUI_USE_STB_SPRINTF) && (defined(__clang__) || defined(__GNUC__)) -#define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) -#define IM_FMTLIST(FMT) __attribute__((format(printf, FMT, 0))) +//#define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) +//#define IM_FMTLIST(FMT) __attribute__((format(printf, FMT, 0))) +#define IM_FMTARGS(FMT) +#define IM_FMTLIST(FMT) #else #define IM_FMTARGS(FMT) #define IM_FMTLIST(FMT) diff --color -rbu ./imgui_demo.cpp ../scummvm/scummvm/backends/imgui/imgui_demo.cpp --- ./imgui_demo.cpp 2025-06-29 15:22:31 +++ ../scummvm/scummvm/backends/imgui/imgui_demo.cpp 2025-06-29 23:57:31 @@ -3423,7 +3423,7 @@ ImGui::TableNextColumn(); ImGui::SetNextItemWidth(-FLT_MIN); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); - ImGui::InputText("###NoLabel", (char*)(void*)item_category, strlen(item_category), ImGuiInputTextFlags_ReadOnly); + ImGui::InputText("###NoLabel", const_cast(item_category), strlen(item_category), ImGuiInputTextFlags_ReadOnly); ImGui::PopStyleVar(); } diff --color -rbu ./misc/freetype/imgui_freetype.cpp ../scummvm/scummvm/backends/imgui/misc/freetype/imgui_freetype.cpp --- ./misc/freetype/imgui_freetype.cpp 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/misc/freetype/imgui_freetype.cpp 2025-06-29 23:57:31 @@ -37,10 +37,10 @@ // FIXME: cfg.OversampleH, OversampleV are not supported, but generally not necessary with this rasterizer because Hinting makes everything look better. -#include "imgui.h" +#include "backends/imgui/imgui.h" #ifndef IMGUI_DISABLE #include "imgui_freetype.h" -#include "imgui_internal.h" // ImMin,ImMax,ImFontAtlasBuild*, +#include "backends/imgui/imgui_internal.h" // ImMin,ImMax,ImFontAtlasBuild*, #include #include #include FT_FREETYPE_H // diff --color -rbu ./misc/freetype/imgui_freetype.h ../scummvm/scummvm/backends/imgui/misc/freetype/imgui_freetype.h --- ./misc/freetype/imgui_freetype.h 2025-06-29 14:44:11 +++ ../scummvm/scummvm/backends/imgui/misc/freetype/imgui_freetype.h 2025-06-29 23:57:31 @@ -2,7 +2,7 @@ // (headers) #pragma once -#include "imgui.h" // IMGUI_API +#include "backends/imgui/imgui.h" // IMGUI_API #ifndef IMGUI_DISABLE // Usage: