mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Backends: SDL2: Handle gamepad disconnection + fixed increasing refcount. Added ImGui_ImplSDL2_SelectGamepadAuto()/ImGui_ImplSDL2_SelectGamepadExplicit(). (#3884, #6559, #6890)
This commit is contained in:
parent
fd8d6dc5d1
commit
bf1c96d4fa
3 changed files with 74 additions and 6 deletions
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
struct SDL_Window;
|
||||
struct SDL_Renderer;
|
||||
struct _SDL_GameController;
|
||||
typedef union SDL_Event SDL_Event;
|
||||
|
||||
IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context);
|
||||
|
|
@ -36,8 +37,13 @@ IMGUI_IMPL_API void ImGui_ImplSDL2_Shutdown();
|
|||
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);
|
||||
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
static inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter
|
||||
static inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter
|
||||
#endif
|
||||
|
||||
#endif // #ifndef IMGUI_DISABLE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue