Skip to content

Commit 7613777

Browse files
authored
imgui v1.92.2b from #284
Bot: Update dependencies
2 parents 5618824 + 8e638ca commit 7613777

14 files changed

+84
-33
lines changed

.references/imgui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.92.2
1+
v1.92.2b

dcimgui/backends/dcimgui_impl_allegro5.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ CIMGUI_IMPL_API bool cimgui::cImGui_ImplAllegro5_ProcessEvent(cimgui::ALLEGRO_EV
116116
return ::ImGui_ImplAllegro5_ProcessEvent(reinterpret_cast<::ALLEGRO_EVENT*>(event));
117117
}
118118

119+
CIMGUI_IMPL_API void cimgui::cImGui_ImplAllegro5_SetDisplay(cimgui::ALLEGRO_DISPLAY* display)
120+
{
121+
::ImGui_ImplAllegro5_SetDisplay(reinterpret_cast<::ALLEGRO_DISPLAY*>(display));
122+
}
123+
119124
CIMGUI_IMPL_API bool cimgui::cImGui_ImplAllegro5_CreateDeviceObjects(void)
120125
{
121126
return ::ImGui_ImplAllegro5_CreateDeviceObjects();

dcimgui/backends/dcimgui_impl_allegro5.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ CIMGUI_IMPL_API void cImGui_ImplAllegro5_Shutdown(void);
4747
CIMGUI_IMPL_API void cImGui_ImplAllegro5_NewFrame(void);
4848
CIMGUI_IMPL_API void cImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data);
4949
CIMGUI_IMPL_API bool cImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event);
50+
CIMGUI_IMPL_API void cImGui_ImplAllegro5_SetDisplay(ALLEGRO_DISPLAY* display);
5051

5152
// Use if you want to reset your rendering device without losing Dear ImGui state.
5253
CIMGUI_IMPL_API bool cImGui_ImplAllegro5_CreateDeviceObjects(void);

dcimgui/backends/imgui_impl_allegro5.cpp

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// [X] Platform: Clipboard support (from Allegro 5.1.12).
99
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1010
// Missing features or Issues:
11-
// [ ] Renderer: The renderer is suboptimal as we need to convert vertices manually.
11+
// [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually.
1212
// [ ] Platform: Missing gamepad support.
1313

1414
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
@@ -21,6 +21,8 @@
2121

2222
// CHANGELOG
2323
// (minor and older changes stripped away, please see git history for details)
24+
// 2025-08-12: Inputs: fixed missing support for ImGuiKey_PrintScreen under Windows, as raw Allegro 5 does not receive it.
25+
// 2025-08-12: Added ImGui_ImplAllegro5_SetDisplay() function to change current ALLEGRO_DISPLAY, as Allegro applications often need to do that.
2426
// 2025-07-07: Fixed texture update broken on some platforms where ALLEGRO_LOCK_WRITEONLY needed all texels to be rewritten.
2527
// 2025-06-11: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas. Removed ImGui_ImplSDLGPU3_CreateFontsTexture() and ImGui_ImplSDLGPU3_DestroyFontsTexture().
2628
// 2025-02-18: Added ImGuiMouseCursor_Wait and ImGuiMouseCursor_Progress mouse cursor support.
@@ -267,8 +269,6 @@ void ImGui_ImplAllegro5_UpdateTexture(ImTextureData* tex)
267269
al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP | ALLEGRO_MIN_LINEAR | ALLEGRO_MAG_LINEAR);
268270
al_set_new_bitmap_format(ALLEGRO_PIXEL_FORMAT_ABGR_8888_LE);
269271
ALLEGRO_BITMAP* cpu_bitmap = al_create_bitmap(tex->Width, tex->Height);
270-
al_set_new_bitmap_flags(new_bitmap_flags);
271-
al_set_new_bitmap_format(new_bitmap_format);
272272
IM_ASSERT(cpu_bitmap != nullptr && "Backend failed to create texture!");
273273

274274
// Upload pixels
@@ -278,10 +278,15 @@ void ImGui_ImplAllegro5_UpdateTexture(ImTextureData* tex)
278278
al_unlock_bitmap(cpu_bitmap);
279279

280280
// Convert software texture to hardware texture.
281+
al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP);
282+
al_set_new_bitmap_format(ALLEGRO_PIXEL_FORMAT_ANY_32_WITH_ALPHA);
281283
ALLEGRO_BITMAP* gpu_bitmap = al_clone_bitmap(cpu_bitmap);
282284
al_destroy_bitmap(cpu_bitmap);
283285
IM_ASSERT(gpu_bitmap != nullptr && "Backend failed to create texture!");
284286

287+
al_set_new_bitmap_flags(new_bitmap_flags);
288+
al_set_new_bitmap_format(new_bitmap_format);
289+
285290
// Store identifiers
286291
tex->SetTexID((ImTextureID)(intptr_t)gpu_bitmap);
287292
tex->SetStatus(ImTextureStatus_OK);
@@ -476,20 +481,9 @@ bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
476481
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
477482
io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures; // We can honor ImGuiPlatformIO::Textures[] requests during render.
478483

479-
bd->Display = display;
480484
bd->LastCursor = ALLEGRO_SYSTEM_MOUSE_CURSOR_NONE;
481485

482-
// Create custom vertex declaration.
483-
// Unfortunately Allegro doesn't support 32-bit packed colors so we have to convert them to 4 floats.
484-
// We still use a custom declaration to use 'ALLEGRO_PRIM_TEX_COORD' instead of 'ALLEGRO_PRIM_TEX_COORD_PIXEL' else we can't do a reliable conversion.
485-
ALLEGRO_VERTEX_ELEMENT elems[] =
486-
{
487-
{ ALLEGRO_PRIM_POSITION, ALLEGRO_PRIM_FLOAT_2, offsetof(ImDrawVertAllegro, pos) },
488-
{ ALLEGRO_PRIM_TEX_COORD, ALLEGRO_PRIM_FLOAT_2, offsetof(ImDrawVertAllegro, uv) },
489-
{ ALLEGRO_PRIM_COLOR_ATTR, 0, offsetof(ImDrawVertAllegro, col) },
490-
{ 0, 0, 0 }
491-
};
492-
bd->VertexDecl = al_create_vertex_decl(elems, sizeof(ImDrawVertAllegro));
486+
ImGui_ImplAllegro5_SetDisplay(display);
493487

494488
#if ALLEGRO_HAS_CLIPBOARD
495489
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
@@ -518,6 +512,33 @@ void ImGui_ImplAllegro5_Shutdown()
518512
IM_DELETE(bd);
519513
}
520514

515+
void ImGui_ImplAllegro5_SetDisplay(ALLEGRO_DISPLAY* display)
516+
{
517+
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
518+
bd->Display = display;
519+
520+
if (bd->VertexDecl)
521+
{
522+
al_destroy_vertex_decl(bd->VertexDecl);
523+
bd->VertexDecl = NULL;
524+
}
525+
526+
if (bd->Display && !bd->VertexDecl)
527+
{
528+
// Create custom vertex declaration.
529+
// Unfortunately Allegro doesn't support 32-bits packed colors so we have to convert them to 4 floats.
530+
// We still use a custom declaration to use 'ALLEGRO_PRIM_TEX_COORD' instead of 'ALLEGRO_PRIM_TEX_COORD_PIXEL' else we can't do a reliable conversion.
531+
ALLEGRO_VERTEX_ELEMENT elems[] =
532+
{
533+
{ ALLEGRO_PRIM_POSITION, ALLEGRO_PRIM_FLOAT_2, offsetof(ImDrawVertAllegro, pos) },
534+
{ ALLEGRO_PRIM_TEX_COORD, ALLEGRO_PRIM_FLOAT_2, offsetof(ImDrawVertAllegro, uv) },
535+
{ ALLEGRO_PRIM_COLOR_ATTR, 0, offsetof(ImDrawVertAllegro, col) },
536+
{ 0, 0, 0 }
537+
};
538+
bd->VertexDecl = al_create_vertex_decl(elems, sizeof(ImDrawVertAllegro));
539+
}
540+
}
541+
521542
// ev->keyboard.modifiers seems always zero so using that...
522543
static void ImGui_ImplAllegro5_UpdateKeyModifiers()
523544
{
@@ -659,6 +680,11 @@ void ImGui_ImplAllegro5_NewFrame()
659680
io.DeltaTime = bd->Time > 0.0 ? (float)(current_time - bd->Time) : (float)(1.0f / 60.0f);
660681
bd->Time = current_time;
661682

683+
// Allegro 5 doesn't receive PrintScreen under Windows
684+
#ifdef _WIN32
685+
io.AddKeyEvent(ImGuiKey_PrintScreen, (::GetAsyncKeyState(VK_SNAPSHOT) & 0x8000) != 0);
686+
#endif
687+
662688
// Setup mouse cursor shape
663689
ImGui_ImplAllegro5_UpdateMouseCursor();
664690
}

dcimgui/backends/imgui_impl_allegro5.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown();
3232
IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame();
3333
IMGUI_IMPL_API void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data);
3434
IMGUI_IMPL_API bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event);
35+
IMGUI_IMPL_API void ImGui_ImplAllegro5_SetDisplay(ALLEGRO_DISPLAY* display);
3536

3637
// Use if you want to reset your rendering device without losing Dear ImGui state.
3738
IMGUI_IMPL_API bool ImGui_ImplAllegro5_CreateDeviceObjects();

dcimgui/dcimgui.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// **DO NOT EDIT DIRECTLY**
33
// https://github.com/dearimgui/dear_bindings
44

5-
// dear imgui, v1.92.2
5+
// dear imgui, v1.92.2b
66
// (headers)
77

88
// Help:
@@ -32,8 +32,8 @@
3232

3333
// Library Version
3434
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
35-
#define IMGUI_VERSION "1.92.2"
36-
#define IMGUI_VERSION_NUM 19220
35+
#define IMGUI_VERSION "1.92.2b"
36+
#define IMGUI_VERSION_NUM 19222
3737
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
3838
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
3939

dcimgui/dcimgui_internal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// **DO NOT EDIT DIRECTLY**
33
// https://github.com/dearimgui/dear_bindings
44

5-
// dear imgui, v1.92.2
5+
// dear imgui, v1.92.2b
66
struct ImVector_ImFontBakedPtr_t { int Size; int Capacity; ImFontBaked** Data; }; // Instantiation of ImVector<ImFontBaked*>
77
struct ImVector_ImFontAtlasPtr_t { int Size; int Capacity; ImFontAtlas** Data; }; // Instantiation of ImVector<ImFontAtlas*>
88
// (internal structures/api)
@@ -2166,6 +2166,7 @@ struct ImGuiContext_t
21662166
bool ActiveIdHasBeenEditedBefore; // Was the value associated to the widget Edited over the course of the Active state.
21672167
bool ActiveIdHasBeenEditedThisFrame;
21682168
bool ActiveIdFromShortcut;
2169+
ImGuiID ActiveIdDisabledId; // When clicking a disabled item we set ActiveId=window->MoveId to avoid interference with widget code. Actual item ID is stored here.
21692170
int ActiveIdMouseButton : 8;
21702171
ImVec2 ActiveIdClickOffset; // Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
21712172
ImGuiWindow* ActiveIdWindow;

dcimgui/imgui.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.92.2
1+
// dear imgui, v1.92.2b
22
// (main code and documentation)
33

44
// Help:
@@ -4063,6 +4063,7 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
40634063
ActiveIdClickOffset = ImVec2(-1, -1);
40644064
ActiveIdWindow = NULL;
40654065
ActiveIdSource = ImGuiInputSource_None;
4066+
ActiveIdDisabledId = 0;
40664067
ActiveIdMouseButton = -1;
40674068
ActiveIdPreviousFrame = 0;
40684069
memset(&DeactivatedItemData, 0, sizeof(DeactivatedItemData));
@@ -4555,6 +4556,7 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
45554556
g.ActiveIdWindow = window;
45564557
g.ActiveIdHasBeenEditedThisFrame = false;
45574558
g.ActiveIdFromShortcut = false;
4559+
g.ActiveIdDisabledId = 0;
45584560
if (id)
45594561
{
45604562
g.ActiveIdIsAlive = id;
@@ -4656,6 +4658,7 @@ static ImGuiHoveredFlags ApplyHoverFlagsForTooltip(ImGuiHoveredFlags user_flags,
46564658
}
46574659

46584660
// This is roughly matching the behavior of internal-facing ItemHoverable()
4661+
// - we allow hovering to be true when ActiveId==window->MoveID, so that clicking on non-interactive items such as a Text() item still returns true with IsItemHovered()
46594662
// - this should work even for non-interactive items that have no ID, so we cannot use LastItemId
46604663
bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
46614664
{
@@ -4697,7 +4700,17 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
46974700
const ImGuiID id = g.LastItemData.ID;
46984701
if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0)
46994702
if (g.ActiveId != 0 && g.ActiveId != id && !g.ActiveIdAllowOverlap)
4700-
return false;
4703+
{
4704+
// When ActiveId == MoveId it means that either:
4705+
// - (1) user clicked on void _or_ an item with no id, which triggers moving window (ActiveId is set even when window has _NoMove flag)
4706+
// - the (id == 0) test handles it, however, IsItemHovered() will leak between id==0 items (mostly visible when using _NoMove). // FIXME: May be fixed.
4707+
// - (2) user clicked a disabled item. UpdateMouseMovingWindowEndFrame() uses ActiveId == MoveId to avoid interference with item logic + sets ActiveIdDisabledId.
4708+
bool cancel_is_hovered = true;
4709+
if (g.ActiveId == window->MoveId && (id == 0 || g.ActiveIdDisabledId == id))
4710+
cancel_is_hovered = false;
4711+
if (cancel_is_hovered)
4712+
return false;
4713+
}
47014714

47024715
// Test if interactions on this window are blocked by an active popup or modal.
47034716
// The ImGuiHoveredFlags_AllowWhenBlockedByPopup flag will be tested here.
@@ -4778,7 +4791,7 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flag
47784791
if (!g.ActiveIdFromShortcut)
47794792
return false;
47804793

4781-
// Done with rectangle culling so we can perform heavier checks now.
4794+
// We are done with rectangle culling so we can perform heavier checks now.
47824795
if (!(item_flags & ImGuiItemFlags_NoWindowHoverableCheck) && !IsWindowContentHoverable(window, ImGuiHoveredFlags_None))
47834796
{
47844797
g.HoveredIdIsDisabled = true;
@@ -5171,9 +5184,12 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
51715184
g.MovingWindow = NULL;
51725185

51735186
// Cancel moving if clicked over an item which was disabled or inhibited by popups
5174-
// (when g.HoveredIdIsDisabled == true && g.HoveredId == 0 we are inhibited by popups, when g.HoveredIdIsDisabled == true && g.HoveredId != 0 we are over a disabled item)0 already)
5187+
// (when g.HoveredIdIsDisabled == true && g.HoveredId == 0 we are inhibited by popups, when g.HoveredIdIsDisabled == true && g.HoveredId != 0 we are over a disabled item)
51755188
if (g.HoveredIdIsDisabled)
5189+
{
51765190
g.MovingWindow = NULL;
5191+
g.ActiveIdDisabledId = g.HoveredId;
5192+
}
51775193
}
51785194
else if (root_window == NULL && g.NavWindow != NULL)
51795195
{

dcimgui/imgui.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.92.2
1+
// dear imgui, v1.92.2b
22
// (headers)
33

44
// Help:
@@ -28,8 +28,8 @@
2828

2929
// Library Version
3030
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
31-
#define IMGUI_VERSION "1.92.2"
32-
#define IMGUI_VERSION_NUM 19220
31+
#define IMGUI_VERSION "1.92.2b"
32+
#define IMGUI_VERSION_NUM 19222
3333
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
3434
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
3535

dcimgui/imgui_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.92.2
1+
// dear imgui, v1.92.2b
22
// (demo code)
33

44
// Help:

0 commit comments

Comments
 (0)