Commit Graph

53 Commits

Author SHA1 Message Date
Sam Lantinga
82adccc15e Fixed build on Apple TV 2017-02-02 16:56:02 -08:00
Sam Lantinga
d77ab77a7a Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
46dd5015df Fixed compile errors on various platforms 2016-12-22 18:43:00 -07:00
Philipp Wiesemann
a85facd73d Fixed empty parameter list in signatures of internal functions. 2016-11-16 22:08:51 +01:00
Sam Lantinga
496ebf193c Implemented SDL_GetHintBoolean() to make it easier to check boolean hints 2016-10-07 23:40:44 -07:00
Alex Szpakowski
cc31dca617 Added a new hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION.
When set to "1", the orientation of the Apple TV remote affects the axes of the corresponding SDL joystick. It is "0" (disabled) by default.
2016-09-17 01:31:07 -03:00
Sam Lantinga
217f7cab99 Fixed accidental call to SDL_PrivateJoystickHat() 2016-09-13 18:43:55 -07:00
Alex Szpakowski
a714cf6d15 Initial Apple TV / tvOS support.
The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used.

A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
2016-09-13 22:18:06 -03:00
Ryan C. Gordon
90a1db0172 ios: patched to compile. 2016-08-26 15:46:29 -04:00
Sam Lantinga
4880936b9d Added SDL_PrivateJoystickAdded() and SDL_PrivateJoystickRemoved()
Updated the removal code to iterate over all joystick add messages instead of just the first one.
2016-08-26 12:18:08 -07:00
Sam Lantinga
255c182471 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Alex Szpakowski
21abd14c5b iOS: Set the player index of MFi gamepads when the user first presses a button, rather than when it's programatically opened. 2015-12-11 16:41:59 -04:00
Alex Szpakowski
3e1d006d3b iOS: Set the 'player index' of MFi game controllers when they're opened for use.
MFi controllers display their player index via LEDs on the controller.
2015-11-09 18:13:47 -04:00
Alex Szpakowski
2efd918e05 iOS: Fixed MFi game controller triggers to report the proper range of values. 2015-11-09 17:41:54 -04:00
Alex Szpakowski
7d55557677 iOS MFi game controllers: inverted the thumbstick y axis values to match the behavior of other controllers. 2015-11-09 02:32:37 -04:00
Alex Szpakowski
a5f74ea9c8 iOS: show message boxes using the new UIAlertController APIs when supported, rather than the deprecated UIAlertView.
UIAlertController is also supported on tvOS, whereas UIAlertView is not.
2015-09-25 15:17:20 -03:00
Philipp Wiesemann
f39094cc00 iOS: Fixed pointer dereference after free. 2015-09-21 21:19:37 +02:00
Alex Szpakowski
4a556c4c01 Added initial support for MFi game controllers on iOS. 2015-09-20 23:08:36 -03:00
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Philipp Wiesemann
6fb400b336 Fixed typo in internal joystick documentation comments. 2015-04-15 21:29:55 +02:00
Alex Szpakowski
182e206acd Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2015-04-06 15:26:37 -03:00
Ryan C. Gordon
44708540f3 Cleanups in the joystick code.
Removed some redundant state and other confusions.

Fixes Bugzilla #2738.
2015-03-24 13:52:01 -04:00
Philipp Wiesemann
42985f8b4e Updated internal documentation comments. 2015-03-11 21:14:21 +01:00
Alex Szpakowski
06c792a551 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2015-01-24 23:58:07 -04:00
Philipp Wiesemann
a485cc3215 Fixed wrong documentation in joystick implementation source. 2015-01-16 23:07:10 +01:00
Alex Szpakowski
19f09c82c3 Updated the iOS backend code to use Objective-C's automatic reference counting (ARC).
--HG--
branch : iOS-improvements
2014-08-06 03:24:16 -03:00
Alex Szpakowski
c5273b470a Added missing autorelease pool blocks in UIKit backend code. Fixes memory leak issues, especially in SDL_video.
--HG--
branch : iOS-improvements
2014-07-29 00:36:12 -03:00
Alex Szpakowski
fc867e8e30 Minor fix for if SDL_JoystickInit is called more than once without a matching SDL_JoystickQuit.
--HG--
branch : iOS-improvements
2014-07-15 02:04:08 -03:00
Alex Szpakowski
9e004cf9cb iOS now respects SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
--HG--
branch : iOS-improvements
2014-07-15 02:01:43 -03:00
Sam Lantinga
5a816a6c2c Fixed bug 2603 - iOS: update joystick accelerometer code to use CoreMotion instead of the deprecated UIAccelerometer
Alex Szpakowski

SDL's code for exposing the accelerometer as a joystick on iOS currently uses UIAccelerometer, which was superseded by the CoreMotion framework and deprecated since iOS 5.

The UIAccelerometer code still works (for now), but it also throws deprecation warnings whenever SDL is built for iOS, since SDL's deployment target is no longer below iOS 5.

I've created a patch which replaces the old UIAccelerometer code with a replacement based on the CoreMotion framework. It has identical functionality (to SDL users), however iOS apps are now required to link to the CoreMotion framework when using SDL.
2014-06-25 00:20:21 -07:00
Ryan C. Gordon
8f8eddd27f Removed SDL_SYS_JoystickNeedsPolling().
It was simpler to just have the polling (actually: hotplug detection)
 functions return immediately if it's not an appropriate time to poll.

Note that previously, if any joystick/controller was opened, we would poll
 every time anyhow, skipping this function.
2014-06-14 23:31:23 -04:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Philipp Wiesemann
6303c03038 Fixed comments in joystick implementation files claiming to be headers.
It seems comments were originally copied from SDL_sysjoystick.h.
2014-01-29 00:27:54 +01:00
Ryan C. Gordon
03d5719413 Make internal SDL sources include SDL_internal.h instead of SDL_config.h
The new header will include SDL_config.h, but allows for other global stuff.
2013-11-24 23:56:17 -05:00
Sam Lantinga
0ddd72dfde Fixed Y axis inversion on iOS; positive is up, negative is down. 2013-10-20 22:23:09 -07:00
Ryan C. Gordon
910e8a8155 Backout hg changset 898992405fa7; lots of things still use SDL_types.h. :/
Will remove this again at some point in the future, though.
2013-07-09 11:57:32 -04:00
Ryan C. Gordon
173b1e9280 Removed deprecated SDL_types.h header.
Fixes Bugzilla #1945.
2013-07-08 23:37:00 -04:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Ryan C. Gordon
16cdc59bab Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
ab6e6a2c23 Fixed joystick GUID renaming for other platforms 2012-12-11 12:16:28 -08:00
Sam Lantinga
17ec39d5bf Fixed permissions on joystick files 2012-12-11 11:59:08 -08:00
Sam Lantinga
3f5fd55965 Organized joystick hotplug code a bit.
Cleaned up names, return types, etc.
2012-11-27 00:58:12 -08:00
Sam Lantinga
c8ec3dac8e Completed adding new hotplug stubs for the joystick implementations 2012-11-26 22:27:49 -08:00
Sam Lantinga
1eb3ed9437 Fixed iOS joystick support for new API 2012-11-26 21:11:28 -08:00
Sam Lantinga
23950f0183 Added hotplug joystick support and simplified game controller API, courtesy of Alfred Reynolds 2012-11-26 16:37:54 -08:00
Sam Lantinga
b3d60cfcbb Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Sam Lantinga
e256711bb9 Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
6196aa221e SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
a2cdcf5486 Happy 2011! :) 2011-02-11 22:37:15 -08:00