Commit Graph

21 Commits

Author SHA1 Message Date
Sam Lantinga 4fe43f408b Added an entry for the new Steam controller XInput emulation mode 2014-08-11 17:24:54 -07:00
Sam Lantinga cd8f63f280 Hopefully fixed Cygwin build 2014-07-07 13:21:54 -07:00
Sam Lantinga a2d5dd0234 Removed useless assert 2014-07-07 13:19:53 -07:00
Sam Lantinga fc4e798d79 Fixed bug 2631 - Mac: minor code cleanup
Alex Szpakowski

Some minor changes to the Mac-specific backend code:

- Fixed up some code style issues (mostly brace style inconsistencies).

- Fixed a compiler warning in SDL_cocoaevents.m.

- Removed some useless code now that the 10.7 SDK is required to build SDL.

- Removed Gestalt(gestaltSystemVersion, ...) call and switched to NSAppKitVersionNumber for version checking code. Using Gestalt with gestaltSystemVersion will give 0x1090 in Mac OS 10.10+, and the whole Gestalt function was deprecated in Mac OS 10.8.
2014-07-07 12:48:25 -07:00
Sam Lantinga febc47976b SDL_SYS_IsXInputGamepad_DeviceIndex() is only available if SDL_JOYSTICK_XINPUT is true. 2014-07-07 11:44:14 -07:00
Sam Lantinga 1ee96bb994 Fixed mingw64 build and warnings 2014-07-07 10:26:28 -07:00
Sam Lantinga b79e7f32cc Split the XInput and DirectInput code so Windows RT can use the existing XInput support. 2014-07-03 15:39:55 -07:00
David Ludwig 65023e0767 WinRT: Fixed game controller axis mappings
SDL/WinRT currently uses a separate XInput backend from SDL/Win32, as WinRT
has no support for DirectInput.  This change makes SDL/WinRT's XInput
code snag some recently-changed bits from the Win32-specific,
DirectInput + XInput backend, in order to get the SDL_GameController API
working again on WinRT, insofar that axes map to the correct parts.

TODO:
 - test all buttons, making sure WinRT maps buttons the same way that Win32 does
 - consider making the Win32 and WinRT codebases share more stuff, minus
   the sort of duplication happening via this change.  Maybe simulate, or
   stub-out, DirectInput calls when on WinRT?
2014-06-25 22:38:40 -04:00
David Ludwig a838a56d45 WinRT build fix 2014-06-25 22:03:05 -04:00
Sam Lantinga 6a632eb23c 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
Sam Lantinga 52ec151fb0 Fixed bug 2553 - Add support to all XInput devices
This adds support for all XInput devices, exposed through the SDL joystick API.
The button and axis reporting for XInput devices has been changed to match DirectInput and other platforms.
The game controller xinput mapping has been updated so this change is seamless.
There is a new hint, SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING, for any applications that have hardcoded the old xinput button and axis set. This hint will be removed in SDL 2.1.
2014-06-24 13:31:25 -07:00
Sam Lantinga 7b7828a46e You shouldn't get axis and hat events when your application doesn't have focus (unless you use the SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint) 2014-06-21 21:30:49 -07:00
Sam Lantinga 54771080f3 Add controller mapping for Bluetooth DualShock 4 controllers on Linux
Frank Praznik

Add a gamepad mapping entry for Bluetooth DualShock 4 controllers on Linux.
The button mapping is the same as the USB controller, but the GUID is
different.
2014-06-15 13:05:30 -07:00
Ryan C. Gordon 446d19c4de 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
Ryan C. Gordon 9e5504f89d Mac: Run the CFRunLoop in joystick mode during SDL_SYS_JoystickNeedsPolling().
This fixes hotplugging failing to detect devices.
2014-06-13 14:52:26 -04:00
Alfred Reynolds 8c2c744ad5 - fixed crash if you removed a device twice, the deviceRef is invalid if removed from the removed device callback (added in http://hg.libsdl.org/SDL/rev/d4e4d0fcda03 ). 2014-06-13 10:50:24 -07:00
Sam Lantinga da6d9a9f2a Added annotations to help code analysis tools
CR: Bruce Dawson
2014-06-04 10:56:56 -07:00
Sam Lantinga e772f0df2b Added a binding for the NVIDIA Shield controller 2014-05-13 12:10:37 -07:00
Sam Lantinga 6735097332 Updated coding style to match the rest of SDL 2014-05-13 11:32:36 -07:00
Ryan C. Gordon 5d7562c7e2 Mac OS X: Look for joystick hotplug in its own CFRunLoop.
This allows the joystick hotplug to function without the main event loop
 (specifically: without SDL_INIT_VIDEO), and moves explicit polling for
 joysticks where it belongs at the low-level: in SDL_SYS_JoystickDetect().

This lets apps call SDL_JoystickUpdate() to get hotplug events and keep
 SDL_NumJoysticks() correct, as expected. As SDL_PumpEvents() (and
 SDL_PollEvents, etc) calls SDL_JoystickUpdate(), existing apps will function
 as before.

Thanks to "raskie" on the forums for pointing this out!
2014-04-24 23:24:48 -04:00
David Ludwig 3dcb451f85 Added a README file regarding WinRT support
To note, this file is currently formatted with CRLF line endings, rather than
LF, to allow the file to be viewed with Notepad.
2014-04-09 21:29:19 -04:00