@ -269,8 +269,9 @@ static void ImGui_ImplSDL3_UpdateKeyModifiers(SDL_Keymod sdl_key_mods)
// If you have multiple SDL events and some of them are not meant to be used by dear imgui, you may need to filter events based on their windowID field.
bool ImGui_ImplSDL3_ProcessEvent ( const SDL_Event * event )
{
ImGuiIO & io = ImGui : : GetIO ( ) ;
ImGui_ImplSDL3_Data * bd = ImGui_ImplSDL3_GetBackendData ( ) ;
IM_ASSERT ( bd ! = nullptr & & " Context or backend not initialized! Did you call ImGui_ImplSDL3_Init()? " ) ;
ImGuiIO & io = ImGui : : GetIO ( ) ;
switch ( event - > type )
{
@ -629,36 +630,36 @@ static void ImGui_ImplSDL3_UpdateGamepads()
// Update gamepad inputs
const int thumb_dead_zone = 8000 ; // SDL_gamepad.h suggests using this value.
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadStart , SDL_GAMEPAD_BUTTON_START ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadBack , SDL_GAMEPAD_BUTTON_BACK ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadFaceLeft , SDL_GAMEPAD_BUTTON_WEST ) ; // Xbox X, PS Square
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadFaceRight , SDL_GAMEPAD_BUTTON_EAST ) ; // Xbox B, PS Circle
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadFaceUp , SDL_GAMEPAD_BUTTON_NORTH ) ; // Xbox Y, PS Triangle
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadFaceDown , SDL_GAMEPAD_BUTTON_SOUTH ) ; // Xbox A, PS Cross
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadDpadLeft , SDL_GAMEPAD_BUTTON_DPAD_LEFT ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadDpadRight , SDL_GAMEPAD_BUTTON_DPAD_RIGHT ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadDpadUp , SDL_GAMEPAD_BUTTON_DPAD_UP ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadDpadDown , SDL_GAMEPAD_BUTTON_DPAD_DOWN ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadL1 , SDL_GAMEPAD_BUTTON_LEFT_SHOULDER ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadR1 , SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadL2 , SDL_GAMEPAD_AXIS_LEFT_TRIGGER , 0.0f , 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadR2 , SDL_GAMEPAD_AXIS_RIGHT_TRIGGER , 0.0f , 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadL3 , SDL_GAMEPAD_BUTTON_LEFT_STICK ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadR3 , SDL_GAMEPAD_BUTTON_RIGHT_STICK ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadLStickLeft , SDL_GAMEPAD_AXIS_LEFTX , - thumb_dead_zone , - 32768 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadLStickRight , SDL_GAMEPAD_AXIS_LEFTX , + thumb_dead_zone , + 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadLStickUp , SDL_GAMEPAD_AXIS_LEFTY , - thumb_dead_zone , - 32768 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadLStickDown , SDL_GAMEPAD_AXIS_LEFTY , + thumb_dead_zone , + 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadRStickLeft , SDL_GAMEPAD_AXIS_RIGHTX , - thumb_dead_zone , - 32768 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadRStickRight , SDL_GAMEPAD_AXIS_RIGHTX , + thumb_dead_zone , + 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadRStickUp , SDL_GAMEPAD_AXIS_RIGHTY , - thumb_dead_zone , - 32768 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadRStickDown , SDL_GAMEPAD_AXIS_RIGHTY , + thumb_dead_zone , + 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadStart , SDL_GAMEPAD_BUTTON_START ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadBack , SDL_GAMEPAD_BUTTON_BACK ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadFaceLeft , SDL_GAMEPAD_BUTTON_WEST ) ; // Xbox X, PS Square
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadFaceRight , SDL_GAMEPAD_BUTTON_EAST ) ; // Xbox B, PS Circle
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadFaceUp , SDL_GAMEPAD_BUTTON_NORTH ) ; // Xbox Y, PS Triangle
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadFaceDown , SDL_GAMEPAD_BUTTON_SOUTH ) ; // Xbox A, PS Cross
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadDpadLeft , SDL_GAMEPAD_BUTTON_DPAD_LEFT ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadDpadRight , SDL_GAMEPAD_BUTTON_DPAD_RIGHT ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadDpadUp , SDL_GAMEPAD_BUTTON_DPAD_UP ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadDpadDown , SDL_GAMEPAD_BUTTON_DPAD_DOWN ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadL1 , SDL_GAMEPAD_BUTTON_LEFT_SHOULDER ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadR1 , SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadL2 , SDL_GAMEPAD_AXIS_LEFT_TRIGGER , 0.0f , 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadR2 , SDL_GAMEPAD_AXIS_RIGHT_TRIGGER , 0.0f , 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadL3 , SDL_GAMEPAD_BUTTON_LEFT_STICK ) ;
ImGui_ImplSDL3_UpdateGamepadButton ( bd , io , ImGuiKey_GamepadR3 , SDL_GAMEPAD_BUTTON_RIGHT_STICK ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadLStickLeft , SDL_GAMEPAD_AXIS_LEFTX , - thumb_dead_zone , - 32768 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadLStickRight , SDL_GAMEPAD_AXIS_LEFTX , + thumb_dead_zone , + 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadLStickUp , SDL_GAMEPAD_AXIS_LEFTY , - thumb_dead_zone , - 32768 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadLStickDown , SDL_GAMEPAD_AXIS_LEFTY , + thumb_dead_zone , + 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadRStickLeft , SDL_GAMEPAD_AXIS_RIGHTX , - thumb_dead_zone , - 32768 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadRStickRight , SDL_GAMEPAD_AXIS_RIGHTX , + thumb_dead_zone , + 32767 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadRStickUp , SDL_GAMEPAD_AXIS_RIGHTY , - thumb_dead_zone , - 32768 ) ;
ImGui_ImplSDL3_UpdateGamepadAnalog ( bd , io , ImGuiKey_GamepadRStickDown , SDL_GAMEPAD_AXIS_RIGHTY , + thumb_dead_zone , + 32767 ) ;
}
void ImGui_ImplSDL3_NewFrame ( )
{
ImGui_ImplSDL3_Data * bd = ImGui_ImplSDL3_GetBackendData ( ) ;
IM_ASSERT ( bd ! = nullptr & & " Did you call ImGui_ImplSDL3_Init()? " ) ;
IM_ASSERT ( bd ! = nullptr & & " Context or backend not initialized! Did you call ImGui_ImplSDL3_Init()?" ) ;
ImGuiIO & io = ImGui : : GetIO ( ) ;
// Setup display size (every frame to accommodate for window resizing)