Backends: SDL2: Amend new API, all support for multiple gamepads. (#3884, #6559, #6890)

This commit is contained in:
ocornut
2024-02-13 18:55:14 +01:00
parent f966da1f8f
commit d15e4100b8
3 changed files with 113 additions and 78 deletions
+4 -3
View File
@@ -38,9 +38,10 @@ IMGUI_IMPL_API void ImGui_ImplSDL2_NewFrame();
IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event);
// Gamepad selection automatically starts in Auto mode, picking first available SDL_GameController. You may override this.
// When using Explicit selection, caller is responsible for opening/closing gamepad.
IMGUI_IMPL_API void ImGui_ImplSDL2_SelectGamepadAuto();
IMGUI_IMPL_API void ImGui_ImplSDL2_SelectGamepadExplicit(struct _SDL_GameController* gamepad);
// When using manual mode, caller is responsible for opening/closing gamepad.
IMGUI_IMPL_API void ImGui_ImplSDL2_SetGamepadModeAutoFirst(); // Use first available gamepad (default)
IMGUI_IMPL_API void ImGui_ImplSDL2_SetGamepadModeAutoAll();
IMGUI_IMPL_API void ImGui_ImplSDL2_SetGamepadModeManual(struct _SDL_GameController** gamepads_array, int gamepads_count);
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
static inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter