WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 44e7afe

Browse files
authored
Merge branch 'ocornut:master' into gamepad-poll-events
2 parents 74f11ae + 702a678 commit 44e7afe

25 files changed

+155
-102
lines changed

backends/imgui_impl_android.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen.
77
// Missing features or Issues:
88
// [ ] Platform: Clipboard support.
9-
// [ ] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
9+
// [ ] Platform: Gamepad support.
1010
// [ ] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. FIXME: Check if this is even possible with Android.
1111
// Important:
1212
// - Consider using SDL or GLFW backend on Android, which will be more full-featured than this.

backends/imgui_impl_android.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen.
77
// Missing features or Issues:
88
// [ ] Platform: Clipboard support.
9-
// [ ] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
9+
// [ ] Platform: Gamepad support.
1010
// [ ] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. FIXME: Check if this is even possible with Android.
1111
// Important:
1212
// - Consider using SDL or GLFW backend on Android, which will be more full-featured than this.

backends/imgui_impl_glfw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ static inline float Saturate(float v) { return v < 0.0f ? 0.0f : v > 1.0f ? 1.0
789789
static void ImGui_ImplGlfw_UpdateGamepads()
790790
{
791791
ImGuiIO& io = ImGui::GetIO();
792-
if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs.
792+
if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs, but see #8075
793793
return;
794794

795795
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;

backends/imgui_impl_osx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// [X] Platform: Clipboard support is part of core Dear ImGui (no specific code in this backend).
88
// [X] Platform: Mouse support. Can discriminate Mouse/Pen.
99
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy kVK_* values are obsolete since 1.87 and not supported since 1.91.5]
10-
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
10+
// [X] Platform: Gamepad support.
1111
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1212
// [X] Platform: IME support.
1313
// Missing features or Issues:

backends/imgui_impl_osx.mm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// [X] Platform: Clipboard support is part of core Dear ImGui (no specific code in this backend).
88
// [X] Platform: Mouse support. Can discriminate Mouse/Pen.
99
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy kVK_* values are obsolete since 1.87 and not supported since 1.91.5]
10-
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
10+
// [X] Platform: Gamepad support.
1111
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1212
// [X] Platform: IME support.
1313
// Missing features or Issues:
@@ -31,6 +31,7 @@
3131

3232
// CHANGELOG
3333
// (minor and older changes stripped away, please see git history for details)
34+
// 2025-03-21: Fill gamepad inputs and set ImGuiBackendFlags_HasGamepad regardless of ImGuiConfigFlags_NavEnableGamepad being set.
3435
// 2025-01-20: Removed notification observer when shutting down. (#8331)
3536
// 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
3637
// - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn
@@ -536,7 +537,7 @@ static void ImGui_ImplOSX_UpdateMouseCursor()
536537
else
537538
{
538539
NSCursor* desired = bd->MouseCursors[imgui_cursor] ?: bd->MouseCursors[ImGuiMouseCursor_Arrow];
539-
// -[NSCursor set] generates measureable overhead if called unconditionally.
540+
// -[NSCursor set] generates measurable overhead if called unconditionally.
540541
if (desired != NSCursor.currentCursor)
541542
{
542543
[desired set];
@@ -552,8 +553,6 @@ static void ImGui_ImplOSX_UpdateMouseCursor()
552553
static void ImGui_ImplOSX_UpdateGamepads()
553554
{
554555
ImGuiIO& io = ImGui::GetIO();
555-
if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs.
556-
return;
557556

558557
#if APPLE_HAS_CONTROLLER
559558
GCController* controller = GCController.current;

backends/imgui_impl_sdl2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// [X] Platform: Clipboard support.
88
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.
99
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values are obsolete since 1.87 and not supported since 1.91.5]
10-
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
10+
// [X] Platform: Gamepad support.
1111
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1212
// [X] Platform: Basic IME support. App needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");' before SDL_CreateWindow()!.
1313

@@ -21,6 +21,7 @@
2121

2222
// CHANGELOG
2323
// (minor and older changes stripped away, please see git history for details)
24+
// 2025-03-21: Fill gamepad inputs and set ImGuiBackendFlags_HasGamepad regardless of ImGuiConfigFlags_NavEnableGamepad being set.
2425
// 2025-03-10: When dealing with OEM keys, use scancodes instead of translated keycodes to choose ImGuiKey values. (#7136, #7201, #7206, #7306, #7670, #7672, #8468)
2526
// 2025-02-26: Only start SDL_CaptureMouse() when mouse is being dragged, to mitigate issues with e.g.Linux debuggers not claiming capture back. (#6410, #3650)
2627
// 2025-02-24: Avoid calling SDL_GetGlobalMouseState() when mouse is in relative mode.

backends/imgui_impl_sdl2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// [X] Platform: Clipboard support.
77
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.
88
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values are obsolete since 1.87 and not supported since 1.91.5]
9-
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
9+
// [X] Platform: Gamepad support.
1010
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1111
// [X] Platform: Basic IME support. App needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");' before SDL_CreateWindow()!.
1212

backends/imgui_impl_sdl3.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// [X] Platform: Clipboard support.
77
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.
88
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values are obsolete since 1.87 and not supported since 1.91.5]
9-
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
9+
// [X] Platform: Gamepad support.
1010
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1111
// [X] Platform: IME support.
1212

@@ -20,6 +20,7 @@
2020

2121
// CHANGELOG
2222
// (minor and older changes stripped away, please see git history for details)
23+
// 2025-03-21: Fill gamepad inputs and set ImGuiBackendFlags_HasGamepad regardless of ImGuiConfigFlags_NavEnableGamepad being set.
2324
// 2025-03-10: When dealing with OEM keys, use scancodes instead of translated keycodes to choose ImGuiKey values. (#7136, #7201, #7206, #7306, #7670, #7672, #8468)
2425
// 2025-02-26: Only start SDL_CaptureMouse() when mouse is being dragged, to mitigate issues with e.g.Linux debuggers not claiming capture back. (#6410, #3650)
2526
// 2025-02-24: Avoid calling SDL_GetGlobalMouseState() when mouse is in relative mode.

backends/imgui_impl_sdl3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// [X] Platform: Clipboard support.
77
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.
88
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values are obsolete since 1.87 and not supported since 1.91.5]
9-
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
9+
// [X] Platform: Gamepad support.
1010
// [X] Platform: Mouse cursor shape and visibility (ImGuiBackendFlags_HasMouseCursors). Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
1111
// [X] Platform: IME support.
1212

backends/imgui_impl_sdlgpu3.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
// - Introduction, links and more at the top of imgui.cpp
1818

1919
// Important note to the reader who wish to integrate imgui_impl_sdlgpu3.cpp/.h in their own engine/app.
20-
// - Unlike other backends, the user must call the function Imgui_ImplSDLGPU3_PrepareDrawData() BEFORE issuing a SDL_GPURenderPass containing ImGui_ImplSDLGPU3_RenderDrawData.
20+
// - Unlike other backends, the user must call the function ImGui_ImplSDLGPU3_PrepareDrawData() BEFORE issuing a SDL_GPURenderPass containing ImGui_ImplSDLGPU3_RenderDrawData.
2121
// Calling the function is MANDATORY, otherwise the ImGui will not upload neither the vertex nor the index buffer for the GPU. See imgui_impl_sdlgpu3.cpp for more info.
2222

2323
// CHANGELOG
24+
// 2025-03-21: Fixed typo in function name Imgui_ImplSDLGPU3_PrepareDrawData() -> ImGui_ImplSDLGPU3_PrepareDrawData().
2425
// 2025-01-16: Renamed ImGui_ImplSDLGPU3_InitInfo::GpuDevice to Device.
2526
// 2025-01-09: SDL_GPU: Added the SDL_GPU3 backend.
2627

@@ -134,7 +135,7 @@ static void CreateOrResizeBuffer(SDL_GPUBuffer** buffer, uint32_t* old_size, uin
134135
// SDL_GPU doesn't allow copy passes to occur while a render or compute pass is bound!
135136
// The only way to allow a user to supply their own RenderPass (to render to a texture instead of the window for example),
136137
// is to split the upload part of ImGui_ImplSDLGPU3_RenderDrawData() to another function that needs to be called by the user before rendering.
137-
void Imgui_ImplSDLGPU3_PrepareDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffer* command_buffer)
138+
void ImGui_ImplSDLGPU3_PrepareDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffer* command_buffer)
138139
{
139140
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
140141
int fb_width = (int)(draw_data->DisplaySize.x * draw_data->FramebufferScale.x);
@@ -366,7 +367,7 @@ void ImGui_ImplSDLGPU3_DestroyFontsTexture()
366367
io.Fonts->SetTexID(0);
367368
}
368369

369-
static void Imgui_ImplSDLGPU3_CreateShaders()
370+
static void ImGui_ImplSDLGPU3_CreateShaders()
370371
{
371372
// Create the shader modules
372373
ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData();
@@ -431,7 +432,7 @@ static void ImGui_ImplSDLGPU3_CreateGraphicsPipeline()
431432
{
432433
ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData();
433434
ImGui_ImplSDLGPU3_InitInfo* v = &bd->InitInfo;
434-
Imgui_ImplSDLGPU3_CreateShaders();
435+
ImGui_ImplSDLGPU3_CreateShaders();
435436

436437
SDL_GPUVertexBufferDescription vertex_buffer_desc[1];
437438
vertex_buffer_desc[0].slot = 0;

0 commit comments

Comments
 (0)