Parcourir la source

Removed SDL_IPHONE_MAX_GFORCE

We no longer support interpreting the accelerometer as a joystick.

Fixes https://github.com/libsdl-org/SDL/issues/11005
Sam Lantinga il y a 6 mois
Parent
commit
91b074beb7
3 fichiers modifiés avec 2 ajouts et 14 suppressions
  1. 0 8
      docs/README-ios.md
  2. 2 0
      docs/README-migration.md
  3. 0 6
      include/SDL3/SDL_joystick.h

+ 0 - 8
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
 ==============================================================================
 

+ 2 - 0
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
 

+ 0 - 6
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 */
 
 /**