From 1dd4c2d6704cdaa7f3ed52fcf1b8cef3bbeb5837 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 29 Jun 2025 23:24:04 +0200 Subject: [PATCH] Update ImGui to 1.92.0-docking. --- cmake/imgui-loader.patch | 24 ++++++++++++------------ cmake/vendor.cmake | 2 +- profiler/src/Fonts.cpp | 9 +++------ profiler/src/main.cpp | 3 +-- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/cmake/imgui-loader.patch b/cmake/imgui-loader.patch index a00f479c..afe0b41f 100644 --- a/cmake/imgui-loader.patch +++ b/cmake/imgui-loader.patch @@ -1,8 +1,8 @@ -diff --git a/backends/imgui_impl_opengl3_loader.h b/backends/imgui_impl_opengl3_loader.h -index d6ffa5a2d..e48372c64 100644 ---- a/backends/imgui_impl_opengl3_loader.h -+++ b/backends/imgui_impl_opengl3_loader.h -@@ -179,6 +179,7 @@ typedef khronos_uint8_t GLubyte; +diff --git i/backends/imgui_impl_opengl3_loader.h w/backends/imgui_impl_opengl3_loader.h +index 4ca0536..a1ff572 100644 +--- i/backends/imgui_impl_opengl3_loader.h ++++ w/backends/imgui_impl_opengl3_loader.h +@@ -180,6 +180,7 @@ typedef khronos_uint8_t GLubyte; #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 #define GL_LINEAR 0x2601 @@ -10,7 +10,7 @@ index d6ffa5a2d..e48372c64 100644 #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_WRAP_S 0x2802 -@@ -241,8 +242,10 @@ GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures); +@@ -244,8 +245,10 @@ GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures); #define GL_TEXTURE0 0x84C0 #define GL_ACTIVE_TEXTURE 0x84E0 typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); @@ -21,16 +21,16 @@ index d6ffa5a2d..e48372c64 100644 #endif #endif /* GL_VERSION_1_3 */ #ifndef GL_VERSION_1_4 -@@ -478,7 +481,7 @@ GL3W_API GL3WglProc imgl3wGetProcAddress(const char *proc); +@@ -481,7 +484,7 @@ GL3W_API GL3WglProc imgl3wGetProcAddress(const char *proc); /* gl3w internal state */ union ImGL3WProcs { -- GL3WglProc ptr[59]; -+ GL3WglProc ptr[60]; +- GL3WglProc ptr[60]; ++ GL3WglProc ptr[61]; struct { PFNGLACTIVETEXTUREPROC ActiveTexture; PFNGLATTACHSHADERPROC AttachShader; -@@ -494,6 +497,7 @@ union ImGL3WProcs { +@@ -497,6 +500,7 @@ union ImGL3WProcs { PFNGLCLEARPROC Clear; PFNGLCLEARCOLORPROC ClearColor; PFNGLCOMPILESHADERPROC CompileShader; @@ -38,7 +38,7 @@ index d6ffa5a2d..e48372c64 100644 PFNGLCREATEPROGRAMPROC CreateProgram; PFNGLCREATESHADERPROC CreateShader; PFNGLDELETEBUFFERSPROC DeleteBuffers; -@@ -559,6 +563,7 @@ GL3W_API extern union ImGL3WProcs imgl3wProcs; +@@ -563,6 +567,7 @@ GL3W_API extern union ImGL3WProcs imgl3wProcs; #define glClear imgl3wProcs.gl.Clear #define glClearColor imgl3wProcs.gl.ClearColor #define glCompileShader imgl3wProcs.gl.CompileShader @@ -46,7 +46,7 @@ index d6ffa5a2d..e48372c64 100644 #define glCreateProgram imgl3wProcs.gl.CreateProgram #define glCreateShader imgl3wProcs.gl.CreateShader #define glDeleteBuffers imgl3wProcs.gl.DeleteBuffers -@@ -854,6 +859,7 @@ static const char *proc_names[] = { +@@ -859,6 +864,7 @@ static const char *proc_names[] = { "glClear", "glClearColor", "glCompileShader", diff --git a/cmake/vendor.cmake b/cmake/vendor.cmake index 2b9c5f03..41ece9b1 100644 --- a/cmake/vendor.cmake +++ b/cmake/vendor.cmake @@ -136,7 +136,7 @@ target_include_directories(TracyGetOpt PUBLIC ${GETOPT_DIR}) CPMAddPackage( NAME ImGui GITHUB_REPOSITORY ocornut/imgui - GIT_TAG v1.91.9b-docking + GIT_TAG v1.92.0-docking DOWNLOAD_ONLY TRUE PATCHES "${CMAKE_CURRENT_LIST_DIR}/imgui-emscripten.patch" diff --git a/profiler/src/Fonts.cpp b/profiler/src/Fonts.cpp index b08f233e..38003594 100644 --- a/profiler/src/Fonts.cpp +++ b/profiler/src/Fonts.cpp @@ -30,14 +30,14 @@ void LoadFonts( float scale ) ImGuiIO& io = ImGui::GetIO(); ImFontConfig configBasic; - configBasic.FontBuilderFlags = ImGuiFreeTypeBuilderFlags_LightHinting; + configBasic.FontLoaderFlags = ImGuiFreeTypeBuilderFlags_LightHinting; configBasic.FontDataOwnedByAtlas = false; ImFontConfig configMerge; configMerge.MergeMode = true; - configMerge.FontBuilderFlags = ImGuiFreeTypeBuilderFlags_LightHinting; + configMerge.FontLoaderFlags = ImGuiFreeTypeBuilderFlags_LightHinting; configMerge.FontDataOwnedByAtlas = false; ImFontConfig configFixed; - configFixed.FontBuilderFlags = ImGuiFreeTypeBuilderFlags_LightHinting; + configFixed.FontLoaderFlags = ImGuiFreeTypeBuilderFlags_LightHinting; configFixed.GlyphExtraAdvanceX = -1; configFixed.FontDataOwnedByAtlas = false; @@ -68,7 +68,4 @@ void LoadFonts( float scale ) g_fonts.italic = io.Fonts->AddFontFromMemoryTTF( (void*)fontItalic->data(), fontItalic->size(), round( 15.0f * scale ), &configBasic, rangesText ); io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 20.0f * scale ), &configMerge, rangesIcons ); - - ImGui_ImplOpenGL3_DestroyFontsTexture(); - ImGui_ImplOpenGL3_CreateFontsTexture(); } diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index 5422fc9a..ff723e4a 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -167,8 +167,7 @@ static void SetupDPIScale() #ifdef __APPLE__ // No need to upscale the style on macOS, but we need to downscale the fonts. - ImGuiIO& io = ImGui::GetIO(); - io.FontGlobalScale = 1.0f / dpiScale; + ImFontCfg::RasterizerDensity = dpiScale; scale = 1.0f; #endif