From 91b074beb7337416c3921da0b667ad88491b9c7b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 1 Oct 2024 18:00:22 -0700 Subject: [PATCH] Removed SDL_IPHONE_MAX_GFORCE We no longer support interpreting the accelerometer as a joystick. Fixes https://github.com/libsdl-org/SDL/issues/11005 --- docs/README-ios.md | 8 -------- docs/README-migration.md | 2 ++ include/SDL3/SDL_joystick.h | 6 ------ 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/docs/README-ios.md b/docs/README-ios.md index 06e2375aa4..5060e169fd 100644 --- a/docs/README-ios.md +++ b/docs/README-ios.md @@ -120,14 +120,6 @@ e.g. Note that if you are using main callbacks instead of a standard C main() function, your SDL_AppEvent() callback will run as these events arrive and you do not need to use SDL_SetEventFilter. -Notes -- Accelerometer as Joystick -============================================================================== - -SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory. - -The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_GetJoystickAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_GetJoystickAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF. - - Notes -- Keyboard ============================================================================== diff --git a/docs/README-migration.md b/docs/README-migration.md index 47d0f69908..29e822b717 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -998,8 +998,10 @@ The following functions have been removed: * SDL_VIRTUAL_JOYSTICK_DESC_VERSION - no longer needed The following symbols have been removed: +* SDL_IPHONE_MAX_GFORCE * SDL_JOYBALLMOTION + The following structures have been renamed: * SDL_JoystickGUID => SDL_GUID diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index 66b466a1b7..520e6eb073 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -161,12 +161,6 @@ typedef enum SDL_JoystickConnectionState #define SDL_JOYSTICK_AXIS_MIN -32768 -/* Set max recognized G-force from accelerometer - See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed - */ -#define SDL_IPHONE_MAX_GFORCE 5.0 - - /* Function prototypes */ /**