perf(startup): drop the unused SDL gamepad subsystem and nav flag
Startup initialised SDL's gamepad subsystem and turned on ImGui gamepad navigation, but the wallet is never driven by a gamepad. Initialising the subsystem enumerates attached controllers and loads the mapping database for nothing. - SDL now starts with the video subsystem only. - ImGui keeps keyboard navigation; the gamepad navigation flag is removed from both the DX11 and the OpenGL setup paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+1
-5
@@ -2432,7 +2432,7 @@ static bool InitSDL()
|
||||
// sub-15 ms waits (vsync pacing, the 200 ms idle wait, >=50 ms thread sleeps), so let the system
|
||||
// timer relax. Ignored on non-Windows platforms; a false return (env override) is harmless.
|
||||
SDL_SetHint(SDL_HINT_TIMER_RESOLUTION, "0");
|
||||
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD)) {
|
||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||
fprintf(stderr, "Error: SDL_Init(): %s\n", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
@@ -2457,8 +2457,6 @@ static bool InitImGui(SDL_Window* window, dragonx::platform::DX11Context& dx)
|
||||
|
||||
// Enable keyboard navigation
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||
// Enable gamepad navigation
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
|
||||
// Enable multi-viewport (windows can float outside main window)
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
|
||||
@@ -2519,8 +2517,6 @@ static bool InitImGui(SDL_Window* window, SDL_GLContext gl_context)
|
||||
|
||||
// Enable keyboard navigation
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||
// Enable gamepad navigation
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
|
||||
// Enable multi-viewport (windows can float outside main window)
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user