1
0
mirror of https://github.com/ocornut/imgui.git synced 2025-02-02 12:37:20 +01:00

Backends: SDL2,SDL3: removed assert preventing using ImGui_ImplSDL2_SetGamepadMode()/ImGui_ImplSDL3_SetGamepadMode() with ImGui_ImplSDL2_GamepadMode_Manual/ImGui_ImplSDL3_GamepadMode_Manual and an empty array. (#8329)

This commit is contained in:
ocornut 2025-01-20 15:24:46 +01:00
parent 8b0af7fddc
commit 4c2e7bb035
3 changed files with 8 additions and 2 deletions

View File

@ -21,6 +21,7 @@
// CHANGELOG // CHANGELOG
// (minor and older changes stripped away, please see git history for details) // (minor and older changes stripped away, please see git history for details)
// 2025-01-20: Made ImGui_ImplSDL2_SetGamepadMode(ImGui_ImplSDL2_GamepadMode_Manual) accept an empty array.
// 2024-10-24: Emscripten: from SDL 2.30.9, SDL_EVENT_MOUSE_WHEEL event doesn't require dividing by 100.0f. // 2024-10-24: Emscripten: from SDL 2.30.9, SDL_EVENT_MOUSE_WHEEL event doesn't require dividing by 100.0f.
// 2024-09-09: use SDL_Vulkan_GetDrawableSize() when available. (#7967, #3190) // 2024-09-09: use SDL_Vulkan_GetDrawableSize() when available. (#7967, #3190)
// 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO: // 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
@ -665,7 +666,7 @@ void ImGui_ImplSDL2_SetGamepadMode(ImGui_ImplSDL2_GamepadMode mode, struct _SDL_
ImGui_ImplSDL2_CloseGamepads(); ImGui_ImplSDL2_CloseGamepads();
if (mode == ImGui_ImplSDL2_GamepadMode_Manual) if (mode == ImGui_ImplSDL2_GamepadMode_Manual)
{ {
IM_ASSERT(manual_gamepads_array != nullptr && manual_gamepads_count > 0); IM_ASSERT(manual_gamepads_array != nullptr || manual_gamepads_count <= 0);
for (int n = 0; n < manual_gamepads_count; n++) for (int n = 0; n < manual_gamepads_count; n++)
bd->Gamepads.push_back(manual_gamepads_array[n]); bd->Gamepads.push_back(manual_gamepads_array[n]);
} }

View File

@ -20,6 +20,7 @@
// CHANGELOG // CHANGELOG
// (minor and older changes stripped away, please see git history for details) // (minor and older changes stripped away, please see git history for details)
// 2025-01-20: Made ImGui_ImplSDL3_SetGamepadMode(ImGui_ImplSDL3_GamepadMode_Manual) accept an empty array.
// 2024-10-24: Emscripten: SDL_EVENT_MOUSE_WHEEL event doesn't require dividing by 100.0f on Emscripten. // 2024-10-24: Emscripten: SDL_EVENT_MOUSE_WHEEL event doesn't require dividing by 100.0f on Emscripten.
// 2024-09-03: Update for SDL3 api changes: SDL_GetGamepads() memory ownership revert. (#7918, #7898, #7807) // 2024-09-03: Update for SDL3 api changes: SDL_GetGamepads() memory ownership revert. (#7918, #7898, #7807)
// 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO: // 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
@ -635,7 +636,7 @@ void ImGui_ImplSDL3_SetGamepadMode(ImGui_ImplSDL3_GamepadMode mode, SDL_Gamepad*
ImGui_ImplSDL3_CloseGamepads(); ImGui_ImplSDL3_CloseGamepads();
if (mode == ImGui_ImplSDL3_GamepadMode_Manual) if (mode == ImGui_ImplSDL3_GamepadMode_Manual)
{ {
IM_ASSERT(manual_gamepads_array != nullptr && manual_gamepads_count > 0); IM_ASSERT(manual_gamepads_array != nullptr || manual_gamepads_count <= 0);
for (int n = 0; n < manual_gamepads_count; n++) for (int n = 0; n < manual_gamepads_count; n++)
bd->Gamepads.push_back(manual_gamepads_array[n]); bd->Gamepads.push_back(manual_gamepads_array[n]);
} }

View File

@ -58,6 +58,10 @@ Other changes:
provided example, to reduce latency. provided example, to reduce latency.
- Examples: Vulkan: better handle VK_SUBOPTIMAL_KHR being returned by - Examples: Vulkan: better handle VK_SUBOPTIMAL_KHR being returned by
vkAcquireNextImageKHR() or vkQueuePresentKHR(). (#7825, #7831) [@NostraMagister] vkAcquireNextImageKHR() or vkQueuePresentKHR(). (#7825, #7831) [@NostraMagister]
- Backends: SDL2: removed assert preventing using ImGui_ImplSDL2_SetGamepadMode()
with ImGui_ImplSDL2_GamepadMode_Manual and an empty array. (#8329)
- Backends: SDL3: removed assert preventing using ImGui_ImplSDL3_SetGamepadMode()
with ImGui_ImplSDL3_GamepadMode_Manual and an empty array. (#8329)
- Backends: SDLGPU3: Exposed ImGui_ImplSDLGPU3_CreateDeviceObjects()/_DestroyDeviceObjects(). - Backends: SDLGPU3: Exposed ImGui_ImplSDLGPU3_CreateDeviceObjects()/_DestroyDeviceObjects().
Removed return value from ImGui_ImplSDLGPU3_CreateFontsTexture(). (#8163, #7998, #7988) Removed return value from ImGui_ImplSDLGPU3_CreateFontsTexture(). (#8163, #7998, #7988)
- Backends: SDL_Renderer2/3: Use endian-dependent RGBA32 texture format, to match - Backends: SDL_Renderer2/3: Use endian-dependent RGBA32 texture format, to match