From fa2c9c46c50095968ca40bbe48ddad83f7325073 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 23 Aug 2024 11:34:15 -0700
Subject: [PATCH] Default SDL_HINT_JOYSTICK_GAMEINPUT to SDL_FALSE
This was causing crashes in IGameInput_RegisterSystemButtonCallback(), presumably on older systems with runtimes using a different function signature. We'll just disable it for now until the GameInput runtime has stabilized and we can tell when it's safe to use.
---
include/SDL3/SDL_hints.h | 4 ++--
src/joystick/gdk/SDL_gameinputjoystick.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index 27a64768f7291..5460863136b11 100644
--- a/include/SDL3/SDL_hints.h
+++ b/include/SDL3/SDL_hints.h
@@ -1232,8 +1232,8 @@ extern "C" {
*
* The variable can be set to the following values:
*
- * - "0": GameInput is not used.
- * - "1": GameInput is used. (default)
+ * - "0": GameInput is not used. (default)
+ * - "1": GameInput is used.
*
* This hint should be set before SDL is initialized.
*
diff --git a/src/joystick/gdk/SDL_gameinputjoystick.c b/src/joystick/gdk/SDL_gameinputjoystick.c
index 7f0f6d48a204b..4a7f9c559d3f3 100644
--- a/src/joystick/gdk/SDL_gameinputjoystick.c
+++ b/src/joystick/gdk/SDL_gameinputjoystick.c
@@ -234,7 +234,7 @@ static int GAMEINPUT_JoystickInit(void)
{
HRESULT hR;
- if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_GAMEINPUT, true)) {
+ if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_GAMEINPUT, false)) {
return 0;
}