Skip to content

Commit cea63f6

Browse files
committed
build: Update ImGui
1 parent 7083b6a commit cea63f6

File tree

15 files changed

+2329
-1438
lines changed

15 files changed

+2329
-1438
lines changed

lib/libimhex/source/ui/imgui_imhex_extensions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,9 +1049,9 @@ namespace ImGuiExt {
10491049

10501050
if (no_progress) {
10511051
auto time = (fmod(ImGui::GetTime() * 2, 1.8) - 0.4);
1052-
RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), ImSaturate(time), ImSaturate(time + 0.2), style.FrameRounding);
1052+
RenderRectFilledInRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), ImSaturate(time), ImSaturate(time + 0.2), style.FrameRounding);
10531053
} else {
1054-
RenderRectFilledRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0F, fraction, style.FrameRounding);
1054+
RenderRectFilledInRangeH(window->DrawList, bb, GetColorU32(ImGuiCol_PlotHistogram), 0.0F, fraction, style.FrameRounding);
10551055
}
10561056
}
10571057

lib/third_party/imgui/backend/include/imgui_impl_opengl3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
4141
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects();
4242
IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
4343

44-
// (Advanced) Use e.g. if you need to precisely control the timing of texture updates (e.g. for staged rendering), by setting ImDrawData::Textures = NULL to handle this manually.
44+
// (Advanced) Use e.g. if you need to precisely control the timing of texture updates (e.g. for staged rendering), by setting ImDrawData::Textures = nullptr to handle this manually.
4545
IMGUI_IMPL_API void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex);
4646

4747
// Configuration flags to add in your imconfig file:

lib/third_party/imgui/backend/source/imgui_impl_opengl3.cpp

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
// CHANGELOG
2626
// (minor and older changes stripped away, please see git history for details)
27-
// 2025-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
27+
// 2026-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
28+
// 2025-12-11: OpenGL: Fixed embedded loader multiple init/shutdown cycles broken on some platforms. (#8792, #9112)
29+
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
2830
// 2025-07-22: OpenGL: Add and call embedded loader shutdown during ImGui_ImplOpenGL3_Shutdown() to facilitate multiple init/shutdown cycles in same process. (#8792)
2931
// 2025-07-15: OpenGL: Set GL_UNPACK_ALIGNMENT to 1 before updating textures (#8802) + restore non-WebGL/ES update path that doesn't require a CPU-side copy.
3032
// 2025-06-11: OpenGL: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas. Removed ImGui_ImplOpenGL3_CreateFontsTexture() and ImGui_ImplOpenGL3_DestroyFontsTexture().
@@ -41,7 +43,7 @@
4143
// 2023-05-09: OpenGL: Support for glBindSampler() backup/restore on ES3. (#6375)
4244
// 2023-04-18: OpenGL: Restore front and back polygon mode separately when supported by context. (#6333)
4345
// 2023-03-23: OpenGL: Properly restoring "no shader program bound" if it was the case prior to running the rendering function. (#6267, #6220, #6224)
44-
// 2023-03-15: OpenGL: Fixed GL loader crash when GL_VERSION returns NULL. (#6154, #4445, #3530)
46+
// 2023-03-15: OpenGL: Fixed GL loader crash when GL_VERSION returns nullptr. (#6154, #4445, #3530)
4547
// 2023-03-06: OpenGL: Fixed restoration of a potentially deleted OpenGL program, by calling glIsProgram(). (#6220, #6224)
4648
// 2022-11-09: OpenGL: Reverted use of glBufferSubData(), too many corruptions issues + old issues seemingly can't be reproed with Intel drivers nowadays (revert 2021-12-15 and 2022-05-23 changes).
4749
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
@@ -305,7 +307,8 @@ struct ImGui_ImplOpenGL3_VtxAttribState
305307
bool ImGui_ImplOpenGL3_InitLoader();
306308
bool ImGui_ImplOpenGL3_InitLoader()
307309
{
308-
// Initialize our loader
310+
// Lazily initialize our loader if not already done
311+
// (to facilitate handling multiple DLL boundaries and multiple context shutdowns we call this from all main entry points)
309312
#ifdef IMGUI_IMPL_OPENGL_LOADER_IMGL3W
310313
if (glGetIntegerv == nullptr && imgl3wInit() != 0)
311314
{
@@ -316,6 +319,13 @@ bool ImGui_ImplOpenGL3_InitLoader()
316319
return true;
317320
}
318321

322+
static void ImGui_ImplOpenGL3_ShutdownLoader()
323+
{
324+
#ifdef IMGUI_IMPL_OPENGL_LOADER_IMGL3W
325+
imgl3wShutdown();
326+
#endif
327+
}
328+
319329
// Functions
320330
bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
321331
{
@@ -402,7 +412,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
402412
glsl_version = "#version 130";
403413
#endif
404414
}
405-
IM_ASSERT((int)strlen(glsl_version) + 2 < IM_ARRAYSIZE(bd->GlslVersionString));
415+
IM_ASSERT((int)strlen(glsl_version) + 2 < IM_COUNTOF(bd->GlslVersionString));
406416
strcpy(bd->GlslVersionString, glsl_version);
407417
strcat(bd->GlslVersionString, "\n");
408418

@@ -440,26 +450,26 @@ void ImGui_ImplOpenGL3_Shutdown()
440450
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
441451
IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
442452
ImGuiIO& io = ImGui::GetIO();
453+
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
443454

444455
ImGui_ImplOpenGL3_ShutdownMultiViewportSupport();
445456
ImGui_ImplOpenGL3_DestroyDeviceObjects();
457+
446458
io.BackendRendererName = nullptr;
447459
io.BackendRendererUserData = nullptr;
448460
io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasTextures | ImGuiBackendFlags_RendererHasViewports);
461+
platform_io.ClearRendererHandlers();
449462
IM_DELETE(bd);
450463

451-
#ifdef IMGUI_IMPL_OPENGL_LOADER_IMGL3W
452-
imgl3wShutdown();
453-
#endif
464+
ImGui_ImplOpenGL3_ShutdownLoader();
454465
}
455466

456467
void ImGui_ImplOpenGL3_NewFrame()
457468
{
458469
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
459470
IM_ASSERT(bd != nullptr && "Context or backend not initialized! Did you call ImGui_ImplOpenGL3_Init()?");
460471

461-
ImGui_ImplOpenGL3_InitLoader(); // Lazily init loader if not already done for e.g. DLL boundaries.
462-
472+
ImGui_ImplOpenGL3_InitLoader();
463473
if (!bd->ShaderHandle)
464474
if (!ImGui_ImplOpenGL3_CreateDeviceObjects())
465475
IM_ASSERT(0 && "ImGui_ImplOpenGL3_CreateDeviceObjects() failed!");
@@ -487,7 +497,7 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
487497
if (useFontShaders) {
488498
glBlendFuncSeparate(GL_SRC1_COLOR, GL_ONE_MINUS_SRC1_COLOR,GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
489499
} else {
490-
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
500+
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
491501
}
492502
#else
493503
// IMHEX PATCH END
@@ -575,7 +585,7 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
575585
if (fb_width <= 0 || fb_height <= 0)
576586
return;
577587

578-
ImGui_ImplOpenGL3_InitLoader(); // Lazily init loader if not already done for e.g. DLL boundaries.
588+
ImGui_ImplOpenGL3_InitLoader();
579589

580590
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
581591

@@ -779,7 +789,7 @@ void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex)
779789
{
780790
// Create and upload new texture to graphics system
781791
//IMGUI_DEBUG_LOG("UpdateTexture #%03d: WantCreate %dx%d\n", tex->UniqueID, tex->Width, tex->Height);
782-
IM_ASSERT(tex->TexID == 0 && tex->BackendUserData == nullptr);
792+
IM_ASSERT(tex->TexID == ImTextureID_Invalid && tex->BackendUserData == nullptr);
783793
IM_ASSERT(tex->Format == ImTextureFormat_RGBA32);
784794
const void* pixels = tex->GetPixels();
785795
GLuint gl_texture_id = 0;
@@ -878,6 +888,7 @@ static bool CheckProgram(GLuint handle, const char* desc)
878888

879889
bool ImGui_ImplOpenGL3_CreateDeviceObjects()
880890
{
891+
ImGui_ImplOpenGL3_InitLoader();
881892
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
882893

883894
// Backup GL state
@@ -1000,7 +1011,7 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects()
10001011
"{\n"
10011012
// IMHEX PATCH BEGIN
10021013
" if (!GammaCorrected)\n"
1003-
" Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n"
1014+
" Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n"
10041015
" else {\n"
10051016
" Out_Color = Frag_Color;\n"
10061017
" SRC1_Color = vec4(texture(Texture, Frag_UV.st).rgb * Frag_Color.aaa,1.0);\n"
@@ -1090,6 +1101,7 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects()
10901101

10911102
void ImGui_ImplOpenGL3_DestroyDeviceObjects()
10921103
{
1104+
ImGui_ImplOpenGL3_InitLoader();
10931105
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
10941106
if (bd->VboHandle) { glDeleteBuffers(1, &bd->VboHandle); bd->VboHandle = 0; }
10951107
if (bd->ElementsHandle) { glDeleteBuffers(1, &bd->ElementsHandle); bd->ElementsHandle = 0; }

lib/third_party/imgui/cimgui/include/cimgui.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4729,7 +4729,6 @@ CIMGUI_API void ImRect_TranslateX(ImRect* self,float dx);
47294729
CIMGUI_API void ImRect_TranslateY(ImRect* self,float dy);
47304730
CIMGUI_API void ImRect_ClipWith(ImRect* self,const ImRect r);
47314731
CIMGUI_API void ImRect_ClipWithFull(ImRect* self,const ImRect r);
4732-
CIMGUI_API void ImRect_Floor(ImRect* self);
47334732
CIMGUI_API bool ImRect_IsInverted(ImRect* self);
47344733
CIMGUI_API void ImRect_ToVec4(ImVec4 *pOut,ImRect* self);
47354734
CIMGUI_API size_t igImBitArrayGetStorageSizeInBytes(int bitcount);
@@ -5261,7 +5260,6 @@ CIMGUI_API void igRenderBullet(ImDrawList* draw_list,ImVec2 pos,ImU32 col);
52615260
CIMGUI_API void igRenderCheckMark(ImDrawList* draw_list,ImVec2 pos,ImU32 col,float sz);
52625261
CIMGUI_API void igRenderArrowPointingAt(ImDrawList* draw_list,ImVec2 pos,ImVec2 half_sz,ImGuiDir direction,ImU32 col);
52635262
CIMGUI_API void igRenderArrowDockMenu(ImDrawList* draw_list,ImVec2 p_min,float sz,ImU32 col);
5264-
CIMGUI_API void igRenderRectFilledRangeH(ImDrawList* draw_list,const ImRect rect,ImU32 col,float x_start_norm,float x_end_norm,float rounding);
52655263
CIMGUI_API void igRenderRectFilledWithHole(ImDrawList* draw_list,const ImRect outer,const ImRect inner,ImU32 col,float rounding);
52665264
CIMGUI_API ImDrawFlags igCalcRoundingFlagsForRectInRect(const ImRect r_in,const ImRect r_outer,float threshold);
52675265
CIMGUI_API void igTextEx(const char* text,const char* text_end,ImGuiTextFlags flags);
@@ -5347,7 +5345,6 @@ CIMGUI_API void igDebugNodeDockNode(ImGuiDockNode* node,const char* label);
53475345
CIMGUI_API void igDebugNodeDrawList(ImGuiWindow* window,ImGuiViewportP* viewport,const ImDrawList* draw_list,const char* label);
53485346
CIMGUI_API void igDebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list,const ImDrawList* draw_list,const ImDrawCmd* draw_cmd,bool show_mesh,bool show_aabb);
53495347
CIMGUI_API void igDebugNodeFont(ImFont* font);
5350-
CIMGUI_API void igDebugNodeFontGlyphesForSrcMask(ImFont* font,ImFontBaked* baked,int src_mask);
53515348
CIMGUI_API void igDebugNodeFontGlyph(ImFont* font,const ImFontGlyph* glyph);
53525349
CIMGUI_API void igDebugNodeTexture(ImTextureData* tex,int int_id,const ImFontAtlasRect* highlight_rect);
53535350
CIMGUI_API void igDebugNodeStorage(ImGuiStorage* storage,const char* label);

lib/third_party/imgui/cimgui/source/cimgui.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,10 +3469,6 @@ CIMGUI_API void ImRect_ClipWithFull(ImRect* self,const ImRect r)
34693469
{
34703470
return self->ClipWithFull(r);
34713471
}
3472-
CIMGUI_API void ImRect_Floor(ImRect* self)
3473-
{
3474-
return self->Floor();
3475-
}
34763472
CIMGUI_API bool ImRect_IsInverted(ImRect* self)
34773473
{
34783474
return self->IsInverted();
@@ -5597,10 +5593,6 @@ CIMGUI_API void igRenderArrowDockMenu(ImDrawList* draw_list,ImVec2 p_min,float s
55975593
{
55985594
return ImGui::RenderArrowDockMenu(draw_list,p_min,sz,col);
55995595
}
5600-
CIMGUI_API void igRenderRectFilledRangeH(ImDrawList* draw_list,const ImRect rect,ImU32 col,float x_start_norm,float x_end_norm,float rounding)
5601-
{
5602-
return ImGui::RenderRectFilledRangeH(draw_list,rect,col,x_start_norm,x_end_norm,rounding);
5603-
}
56045596
CIMGUI_API void igRenderRectFilledWithHole(ImDrawList* draw_list,const ImRect outer,const ImRect inner,ImU32 col,float rounding)
56055597
{
56065598
return ImGui::RenderRectFilledWithHole(draw_list,outer,inner,col,rounding);
@@ -5938,10 +5930,6 @@ CIMGUI_API void igDebugNodeFont(ImFont* font)
59385930
{
59395931
return ImGui::DebugNodeFont(font);
59405932
}
5941-
CIMGUI_API void igDebugNodeFontGlyphesForSrcMask(ImFont* font,ImFontBaked* baked,int src_mask)
5942-
{
5943-
return ImGui::DebugNodeFontGlyphesForSrcMask(font,baked,src_mask);
5944-
}
59455933
CIMGUI_API void igDebugNodeFontGlyph(ImFont* font,const ImFontGlyph* glyph)
59465934
{
59475935
return ImGui::DebugNodeFontGlyph(font,glyph);

0 commit comments

Comments
 (0)