Skip to content

Commit 5e6bf29

Browse files
committed
Merge tag 'v1.92.8-docking' into docking
2 parents 3ef1e5c + b61e563 commit 5e6bf29

128 files changed

Lines changed: 6816 additions & 3682 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 79 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
VS_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
2929
MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
3030
steps:
31-
- uses: actions/checkout@v5
31+
- uses: actions/checkout@v6
3232
with:
3333
path: ${{ github.workspace }}/imgui
3434

@@ -274,7 +274,7 @@ jobs:
274274
working-directory: ${{ github.workspace }}/imgui
275275

276276
steps:
277-
- uses: actions/checkout@v5
277+
- uses: actions/checkout@v6
278278
with:
279279
path: ${{ github.workspace }}/imgui
280280

@@ -343,7 +343,7 @@ jobs:
343343
EOF
344344
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
345345
346-
- name: Build example_null (with large ImDrawIdx + pointer ImTextureID)
346+
- name: Build example_null (with large ImDrawIdx + custom ImTextureID)
347347
run: |
348348
cat > example_single_file.cpp <<'EOF'
349349
@@ -356,6 +356,21 @@ jobs:
356356
EOF
357357
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
358358
359+
cat > example_single_file.cpp <<'EOF'
360+
361+
// Test build ImTextureID defined as a struct
362+
struct SomeType { int a = 0; int b = 0; };
363+
#define ImTextureID SomeType
364+
#define ImTextureID_Invalid SomeType()
365+
inline bool operator==(const SomeType& lhs, const SomeType& rhs) { return lhs.a == rhs.a && lhs.b == rhs.b; }
366+
inline bool operator!=(const SomeType& lhs, const SomeType& rhs) { return lhs.a != rhs.a || lhs.b != rhs.b; }
367+
#define IMGUI_IMPLEMENTATION
368+
#include "misc/single_file/imgui_single_file.h"
369+
#include "examples/example_null/main.cpp"
370+
371+
EOF
372+
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
373+
359374
- name: Build example_null (with IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
360375
run: |
361376
cat > example_single_file.cpp <<'EOF'
@@ -499,7 +514,7 @@ jobs:
499514
working-directory: ${{ github.workspace }}/imgui
500515

501516
steps:
502-
- uses: actions/checkout@v5
517+
- uses: actions/checkout@v6
503518
with:
504519
path: ${{ github.workspace }}/imgui
505520

@@ -510,7 +525,7 @@ jobs:
510525
- name: Build example_null (extra warnings, clang 64-bit)
511526
run: make -C examples/example_null WITH_EXTRA_WARNINGS=1
512527

513-
- name: Build example_null (single file build)
528+
- name: Build macOS example_null (single file build)
514529
run: |
515530
cat > example_single_file.cpp <<'EOF'
516531
@@ -521,7 +536,7 @@ jobs:
521536
EOF
522537
clang++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
523538
524-
- name: Build example_null (single file build, c++20)
539+
- name: Build macOS example_null (single file build, c++20)
525540
run: |
526541
cat > example_single_file.cpp <<'EOF'
527542
@@ -532,7 +547,7 @@ jobs:
532547
EOF
533548
clang++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp
534549
535-
- name: Build example_null (without c++ runtime)
550+
- name: Build macOS example_null (without c++ runtime)
536551
run: |
537552
cat > example_single_file.cpp <<'EOF'
538553
@@ -543,41 +558,45 @@ jobs:
543558
EOF
544559
clang++ -I. -std=c++11 -Wall -Wformat -nodefaultlibs -fno-rtti -fno-exceptions -fno-threadsafe-statics -lc -lm -o example_single_file example_single_file.cpp
545560
546-
- name: Build example_glfw_opengl2
561+
- name: Build macOS example_glfw_opengl2
547562
run: make -C examples/example_glfw_opengl2
563+
if: github.event_name == 'workflow_run'
548564

549-
- name: Build example_glfw_opengl3
565+
- name: Build macOS example_glfw_opengl3
550566
run: make -C examples/example_glfw_opengl3
551567
if: github.event_name == 'workflow_run'
552568

553-
- name: Build example_glfw_metal
569+
- name: Build macOS example_glfw_metal
554570
run: make -C examples/example_glfw_metal
555571

556-
- name: Build example_sdl2_metal
572+
- name: Build macOS example_sdl2_metal
557573
run: make -C examples/example_sdl2_metal
558574

559-
- name: Build example_sdl2_opengl2
575+
- name: Build macOS example_sdl2_opengl2
560576
run: make -C examples/example_sdl2_opengl2
561577
if: github.event_name == 'workflow_run'
562578

563-
- name: Build example_sdl2_opengl3
579+
- name: Build macOS example_sdl2_opengl3
564580
run: make -C examples/example_sdl2_opengl3
581+
if: github.event_name == 'workflow_run'
565582

566-
- name: Build example_sdl3_opengl3
583+
- name: Build macOS example_sdl3_opengl3
567584
run: make -C examples/example_sdl3_opengl3
568585

569-
- name: Build example_apple_metal
586+
- name: Build macOS example_apple_metal
570587
run: xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_macos
588+
if: github.event_name == 'workflow_run'
571589

572-
- name: Build example_apple_opengl2
590+
- name: Build macOS example_apple_opengl2
573591
run: xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2
592+
if: github.event_name == 'workflow_run'
574593

575594
Build-iOS:
576595
runs-on: macos-14
577596
name: Build - iOS
578597

579598
steps:
580-
- uses: actions/checkout@v5
599+
- uses: actions/checkout@v6
581600

582601
- name: Build example_apple_metal
583602
run: |
@@ -589,7 +608,7 @@ jobs:
589608
name: Build - Emscripten
590609

591610
steps:
592-
- uses: actions/checkout@v5
611+
- uses: actions/checkout@v6
593612

594613
- name: Install Dependencies
595614
run: |
@@ -632,7 +651,7 @@ jobs:
632651
name: Build - Android
633652

634653
steps:
635-
- uses: actions/checkout@v5
654+
- uses: actions/checkout@v6
636655

637656
- name: Build example_android_opengl3
638657
run: |
@@ -651,11 +670,11 @@ jobs:
651670
MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
652671

653672
steps:
654-
- uses: actions/checkout@v5
673+
- uses: actions/checkout@v6
655674
with:
656675
path: ${{ github.workspace }}/imgui
657676

658-
- uses: actions/checkout@v5
677+
- uses: actions/checkout@v6
659678
continue-on-error: true
660679
with:
661680
fetch-depth: 1
@@ -706,11 +725,11 @@ jobs:
706725
working-directory: ${{ github.workspace }}/imgui
707726

708727
steps:
709-
- uses: actions/checkout@v5
728+
- uses: actions/checkout@v6
710729
with:
711730
path: ${{ github.workspace }}/imgui
712731

713-
- uses: actions/checkout@v5
732+
- uses: actions/checkout@v6
714733
with:
715734
fetch-depth: 1
716735
repository: ocornut/imgui_test_engine
@@ -735,40 +754,40 @@ jobs:
735754
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
736755
run: ./imgui_test_suite -nogui -nopause -v2 -ve4 -viewport-mock viewport
737756

738-
Test-MacOS:
739-
runs-on: macos-latest
740-
name: Test - MacOS
741-
742-
defaults:
743-
run:
744-
working-directory: ${{ github.workspace }}/imgui
745-
746-
steps:
747-
- uses: actions/checkout@v5
748-
with:
749-
path: ${{ github.workspace }}/imgui
750-
751-
- uses: actions/checkout@v5
752-
with:
753-
fetch-depth: 1
754-
repository: ocornut/imgui_test_engine
755-
path: ${{ github.workspace }}/imgui_test_engine
756-
submodules: true
757-
758-
- name: Build Tests
759-
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
760-
run: make -j$(nproc)
761-
762-
- name: Run Tests
763-
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
764-
run: ./imgui_test_suite -nogui -nopause -v2 -ve4 tests
765-
766-
- name: Check for Docking
767-
id: check_docking
768-
working-directory: ${{ github.workspace }}/imgui
769-
run: echo "has_dock=$(grep -q "#define IMGUI_HAS_DOCK" imgui.h && echo true || echo false)" >> $GITHUB_OUTPUT
770-
771-
- name: Run Viewport Tests
772-
if: steps.check_docking.outputs.has_dock == 'true'
773-
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
774-
run: ./imgui_test_suite -nogui -nopause -v2 -ve4 -viewport-mock viewport
757+
# Test-MacOS:
758+
# runs-on: macos-latest
759+
# name: Test - MacOS
760+
#
761+
# defaults:
762+
# run:
763+
# working-directory: ${{ github.workspace }}/imgui
764+
#
765+
# steps:
766+
# - uses: actions/checkout@v6
767+
# with:
768+
# path: ${{ github.workspace }}/imgui
769+
#
770+
# - uses: actions/checkout@v6
771+
# with:
772+
# fetch-depth: 1
773+
# repository: ocornut/imgui_test_engine
774+
# path: ${{ github.workspace }}/imgui_test_engine
775+
# submodules: true
776+
#
777+
# - name: Build Tests
778+
# working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
779+
# run: make -j$(nproc)
780+
#
781+
# - name: Run Tests
782+
# working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
783+
# run: ./imgui_test_suite -nogui -nopause -v2 -ve4 tests
784+
#
785+
# - name: Check for Docking
786+
# id: check_docking
787+
# working-directory: ${{ github.workspace }}/imgui
788+
# run: echo "has_dock=$(grep -q "#define IMGUI_HAS_DOCK" imgui.h && echo true || echo false)" >> $GITHUB_OUTPUT
789+
#
790+
# - name: Run Viewport Tests
791+
# if: steps.check_docking.outputs.has_dock == 'true'
792+
# working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
793+
# run: ./imgui_test_suite -nogui -nopause -v2 -ve4 -viewport-mock viewport

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
PVS-Studio:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616
with:
1717
fetch-depth: 1
1818

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## OSX artifacts
1+
## Misc artifacts
22
.DS_Store
3+
.claude
4+
.vscode
35

46
## Dear ImGui artifacts
57
imgui.ini
@@ -55,9 +57,6 @@ examples/example_sdl3_wgpu/web/*
5557
.idea
5658
cmake-build-*
5759

58-
## VS code artifacts
59-
.vscode
60-
6160
## Unix executables from our example Makefiles
6261
examples/example_apple_metal/example_apple_metal
6362
examples/example_apple_opengl2/example_apple_opengl2

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2025 Omar Cornut
3+
Copyright (c) 2014-2026 Omar Cornut
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

backends/imgui_impl_allegro5.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1010
// Missing features or Issues:
1111
// [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually.
12+
// [ ] Renderer: Missing support for DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest callbacks: Allegro5 cannot enable/disable LINEAR bitmap flags after creation.
1213
// [ ] Platform: Missing gamepad support.
1314
// [ ] Renderer: Multi-viewport support (multiple windows).
1415

@@ -22,6 +23,7 @@
2223

2324
// CHANGELOG
2425
// (minor and older changes stripped away, please see git history for details)
26+
// 2026-04-23: Added support for standard draw callbacks (in platform_io): DrawCallback_ResetRenderState (others cannot be supported by Allegro5). (#9378)
2527
// 2025-09-18: Call platform_io.ClearRendererHandlers() and platform_io.ClearPlatformHandlers() on shutdown.
2628
// 2025-08-12: Inputs: fixed missing support for ImGuiKey_PrintScreen under Windows, as raw Allegro 5 does not receive it.
2729
// 2025-08-12: Added ImGui_ImplAllegro5_SetDisplay() function to change current ALLEGRO_DISPLAY, as Allegro applications often need to do that.
@@ -137,7 +139,10 @@ static void ImGui_ImplAllegro5_SetupRenderState(ImDrawData* draw_data)
137139
}
138140
}
139141

140-
// Render function.
142+
// Draw callbacks
143+
static void ImGui_ImplAllegro5_DrawCallback_ResetRenderState(const ImDrawList*, const ImDrawCmd*) {} // Intentionally empty. Used as an identifier for rendering loop to call its code. Simpler to implement this way.
144+
145+
// Render function
141146
void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
142147
{
143148
// Avoid rendering when minimized
@@ -153,6 +158,7 @@ void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
153158

154159
// Backup Allegro state that will be modified
155160
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
161+
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
156162
ALLEGRO_TRANSFORM last_transform = *al_get_current_transform();
157163
ALLEGRO_TRANSFORM last_projection_transform = *al_get_current_projection_transform();
158164
int last_clip_x, last_clip_y, last_clip_w, last_clip_h;
@@ -209,8 +215,7 @@ void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
209215
if (pcmd->UserCallback)
210216
{
211217
// User callback, registered via ImDrawList::AddCallback()
212-
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
213-
if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
218+
if (pcmd->UserCallback == ImGui_ImplAllegro5_DrawCallback_ResetRenderState)
214219
ImGui_ImplAllegro5_SetupRenderState(draw_data);
215220
else
216221
pcmd->UserCallback(draw_list, pcmd);
@@ -487,11 +492,12 @@ bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
487492

488493
ImGui_ImplAllegro5_SetDisplay(display);
489494

490-
#if ALLEGRO_HAS_CLIPBOARD
491495
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
496+
#if ALLEGRO_HAS_CLIPBOARD
492497
platform_io.Platform_SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
493498
platform_io.Platform_GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
494499
#endif
500+
platform_io.DrawCallback_ResetRenderState = ImGui_ImplAllegro5_DrawCallback_ResetRenderState;
495501

496502
return true;
497503
}
@@ -525,7 +531,7 @@ void ImGui_ImplAllegro5_SetDisplay(ALLEGRO_DISPLAY* display)
525531
if (bd->VertexDecl)
526532
{
527533
al_destroy_vertex_decl(bd->VertexDecl);
528-
bd->VertexDecl = NULL;
534+
bd->VertexDecl = nullptr;
529535
}
530536

531537
if (bd->Display && !bd->VertexDecl)

backends/imgui_impl_allegro5.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1010
// Missing features or Issues:
1111
// [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually.
12+
// [ ] Renderer: Missing support for DrawCallback_SetSamplerLinear, DrawCallback_SetSamplerNearest callbacks: Allegro5 cannot enable/disable LINEAR bitmap flags after creation.
1213
// [ ] Platform: Missing gamepad support.
1314
// [ ] Renderer: Multi-viewport support (multiple windows).
1415

@@ -39,7 +40,7 @@ IMGUI_IMPL_API void ImGui_ImplAllegro5_SetDisplay(ALLEGRO_DISPLAY* display);
3940
IMGUI_IMPL_API bool ImGui_ImplAllegro5_CreateDeviceObjects();
4041
IMGUI_IMPL_API void ImGui_ImplAllegro5_InvalidateDeviceObjects();
4142

42-
// (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.
43+
// (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.
4344
IMGUI_IMPL_API void ImGui_ImplAllegro5_UpdateTexture(ImTextureData* tex);
4445

4546
#endif // #ifndef IMGUI_DISABLE

0 commit comments

Comments
 (0)