Support calling SteamAPI_InitEx() before SDL_Init(SDL_INIT_GAMEPAD)

Calling SteamAPI_InitEx() will set environment variables that SDL uses to properly support the Steam virtual gamepad. Make sure that we fall back to the real environment for the variables that Steam sets.
This commit is contained in:
Sam Lantinga
2025-12-13 23:42:55 -08:00
parent d780fa144a
commit 517a3d20e8
4 changed files with 21 additions and 8 deletions

View File

@@ -48,6 +48,9 @@
* SDL_INIT_GAMEPAD flag. This causes SDL to scan the system for gamepads, and
* load appropriate drivers.
*
* If you're using SDL gamepad support in a Steam game, you must call
* SteamAPI_InitEx() before calling SDL_Init().
*
* If you would like to receive gamepad updates while the application is in
* the background, you should set the following hint before calling
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS