Commit graph

83 commits

Author SHA1 Message Date
Sam Lantinga
f98a06ec45 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
b97a48ebad commit 1170112da3776fdb06425f62d57b63144c33dc51
Author: James Zipperer <james.zipperer@synapse.com>
Date:   Sun Aug 21 01:19:19 2016 -0700

    bugfix for controller / joystick add / remove being in the event queue at the same time
2016-08-26 11:16:44 -07:00
Ethan Lee
be57775a6c Allow mappings to be added before GameControllerInit 2016-03-07 08:22:55 -05:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
c27d95571f Added broad support for wireless XBox 360 controllers on Linux 2015-12-09 12:11:40 -08:00
Ryan C. Gordon
03cb578e6e Added SDL_JoystickFromInstanceID() and SDL_GameControllerFromInstanceID().
--HG--
extra : amend_source : 110a5505509ddb9ecafed75abd89602986a99696
2015-11-14 12:35:45 -05:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Sam Lantinga
1cbf83b0c0 Added generic xinput fallback for XBox compatible controllers on Linux 2015-05-13 22:37:26 -07:00
Ryan C. Gordon
de88474dda Initial merge of Emscripten port!
With this commit, you can compile SDL2 with Emscripten
( http://emscripten.org/ ), and make your SDL-based C/C++ program
into a web app.

This port was due to the efforts of several people, including: Charlie Birks,
Sathyanarayanan Gunasekaran, Jukka Jylänki, Alon Zakai, Edward Rudd,
Bruce Mitchener, and Martin Gerhardy. (Thanks, everyone!)

--HG--
extra : rebase_source : 97af74c8a5121e926ebe89f123536b5dd6681695
2014-12-18 00:19:52 -05:00
Philipp Wiesemann
76173b195e Added handling of NULL as input for SDL_GameControllerAddMapping(). 2014-10-26 23:28:45 +01:00
Philipp Wiesemann
bbbe3edca1 Fixed SDL_GameControllerMappingForGUID() crashing if no more memory available.
The return value of SDL_malloc() was not checked and NULL therefore not handled.
NULL returned by SDL_GameControllerMapping()/SDL_GameControllerMappingForGUID()
now either means "no mapping" (as before) or "no memory" (just crashed before).
2014-10-26 23:22:53 +01:00
Philipp Wiesemann
8869fe78be Added handling of NULL as input for SDL_GameControllerMapping().
For consistency with the similar functions getting SDL_GameController as input.
Also NULL is no SDL_GameController and therefore can not have a mapping anyway.
2014-10-26 17:53:16 +01:00
Philipp Wiesemann
81958288cc Removed two wrong documentation comments from gamecontroller source.
No replacement because correct documentation is already in SDL_gamecontroller.h.
2014-10-26 17:46:11 +01:00
Philipp Wiesemann
788b558bc8 Fixed wording in SDL_GameControllerAddMappingsFromRW() error message. 2014-10-26 17:44:00 +01:00
Sam Lantinga
9d42bf534d Fixed mingw64 build and warnings 2014-07-07 10:26:28 -07:00
Sam Lantinga
9cdeec59f3 Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
--HG--
rename : src/audio/directsound/directx.h => src/core/windows/SDL_directx.h
rename : src/haptic/windows/SDL_syshaptic.c => src/haptic/windows/SDL_windowshaptic.c
rename : src/haptic/windows/SDL_syshaptic_c.h => src/haptic/windows/SDL_windowshaptic_c.h
rename : src/joystick/windows/SDL_dxjoystick.c => src/joystick/windows/SDL_dinputjoystick.c
rename : src/joystick/windows/SDL_dxjoystick_c.h => src/joystick/windows/SDL_dinputjoystick_c.h
rename : src/joystick/windows/SDL_dxjoystick_c.h => src/joystick/windows/SDL_windowsjoystick_c.h
2014-07-03 15:39:55 -07:00
Sam Lantinga
dc434901da 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
bb480c2b0a Updated coding style to match the rest of SDL 2014-05-13 11:32:36 -07:00
Sam Lantinga
a7d2ebb8d6 Integrated David Ludwig's support for Windows RT 2014-03-09 11:36:47 -07:00
Sam Lantinga
211b54deef Fixed line endings on WinRT source code 2014-03-09 11:06:11 -07:00
Sam Lantinga
cff6eb5155 Null termnate the pUserMappings variable to prevent memory corruption. 2014-02-28 16:24:41 -08:00
Gabriel Jacobo
ac487a8eec Fixes #2417, memory leak in SDL_gamecontroller.c (thanks Leonardo!) 2014-02-24 10:00:10 -03:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
David Ludwig
ebfac58560 WinRT: merged with latest SDL 2.x/HG code
SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library.  The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
2013-11-28 22:09:21 -05:00
Ryan C. Gordon
82edee6971 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.

--HG--
extra : rebase_source : ddf4a4c0dc2c554b98c82700798f343cd91b16e3
2013-11-24 23:56:17 -05:00
Philipp Wiesemann
51f82e27dd Changed return -1 after SDL_SetError() to return SDL_SetError(). 2013-12-25 17:02:15 +01:00
Sam Lantinga
9289bbb732 Generate SDL_CONTROLLERDEVICEADDED events for controllers connected at startup 2013-12-23 15:10:03 -08:00
Sam Lantinga
db521ea67c Fixed detecting the wired XBox 360 controller on Linux
Also added some more debug output to detect issues
2013-12-06 09:13:31 -08:00
Sam Lantinga
4c35a7b408 Fixed compiler warning on Visual Studio 2013-12-06 08:24:00 -08:00
Gabriel Jacobo
137f4aedc1 Adds SDL_GameControllerAddMappingsFromRW, updates controllermap
SDL_GameControllerAddMappingsFromFile is now a convenience macro.

controllermap can now skip bindings by pressing space or clicking/touching the
screen.
2013-12-03 12:01:28 -03:00
Gabriel Jacobo
64ff6df0b8 Adds SDL_GameControllerAddMappingsFromFile 2013-12-02 19:34:08 -03:00
Philipp Wiesemann
2d9c5027be Fixed unreachable return statement warning in gamecontroller source. 2013-11-18 23:43:15 +01:00
David Ludwig
59df93166d WinRT: merged with SDL 2.0.1 codebase 2013-10-27 21:26:46 -04:00
Sam Lantinga
20e65317fa Fixed some warnings building for 64-bit Windows 2013-10-21 01:16:16 -07:00
David Ludwig
88461d442a WinRT: merged with SDL 2.0.0 codebase (aka. SDL hg rev d6a8fa507a45)
--HG--
rename : README.iOS => README-ios.txt
2013-08-12 22:29:55 -04:00
Ryan C. Gordon
6f21990987 Reworked XInput and DirectInput joystick code.
Now multiple XInput controllers map correctly to device indexes instead of grabbing
the first available userid, and are completely separated out from DirectInput.

Also, the hardcoded limitation on number of DirectInput devices is gone. I don't
expect there to really ever be more than eight joysticks plugged into a machine, but
it was a leftover limitation for a static array we didn't actually use anymore.

Fixes Bugzilla #1984. (etc?)

--HG--
extra : rebase_source : 103ce667c1cdd87a3691c9dd9eea2318bad908c8
2013-08-28 16:43:47 -04:00
Sam Lantinga
54d87dfc28 SDL
- detect that you tried to open a gamecontroller in xinput mode and failed, then re-get the mapping for the dinput variant you did open (and most likely now just fail the open)

CR: SamL
2013-08-21 10:32:04 -07:00
Gabriel Jacobo
271e0d67c4 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Sam Lantinga
06741a5761 Moved the game controller database to a separate file and added a script to sort the entries so we can easily check for duplicates 2013-07-12 10:44:55 -07:00
Sam Lantinga
22aec9f625 Oops, that was supposed to be in the Linux section. 2013-07-12 08:21:28 -07:00
Sam Lantinga
8522bf8e38 Fixed name of the Logitech F710 controller 2013-07-11 23:21:09 -07:00
Sam Lantinga
0b2d15eb61 Fixed bug 1853 - Gamecontroller patch to add support for Logitech F510 (Linux)
Gerry JJ

Same mapping as for F710. Xinput mode only since I couldn't get Dinput mode to work at all.
2013-07-11 23:20:29 -07:00
Sam Lantinga
80917f1537 Removed redundant "Controller" names from gamepads, added mapping for Logitech F710 in DirectInput mode 2013-06-07 09:40:07 -07:00
Jørgen P. Tjernø
24fc22545b Mac: Fix invalid PS3 controller mapping.
PS3 controller had swapped D-Pad down & left buttons, as well as X & Y buttons.
Thanks to Alex Szpakowski for the bug report and fix.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1891
2013-06-05 12:48:44 -07:00
Edward Rudd
acb14cfc03 Add trigger value adjustment code to the SDL_GameControllerGetAxis code as well.
- fixes Trigger values when polling instead of using event driven
2013-05-30 22:14:24 -04:00
Edward Rudd
3d874237bc add in Controller configs for Logitech F510 for OS X / Linux
--HG--
extra : rebase_source : 68a7469d9e85d5f090d0299abed42f8ed577499a
2013-05-30 10:42:52 -04:00
David Ludwig
b919f57c12 WinRT: added preliminary joystick / game controller support (minus hotplugging) 2013-05-19 23:30:34 -04:00
Sam Lantinga
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
bc7136f5ba Martin Gerhardy added support for the Jess Technology USB Game Controller 2013-05-16 00:48:20 -07:00
Philipp Wiesemann
e83262a725 Corrected spelling in C source files. 2013-05-01 11:59:54 +02:00