Commit Graph

12 Commits

Author SHA1 Message Date
Sam Lantinga
c49fa37c5b Added SDL hints to filter the set of game controllers reported by SDL 2017-08-09 11:59:29 -07:00
Sam Lantinga
f354024266 Removed unused variable 2017-01-18 12:19:57 -08:00
Sam Lantinga
b0c5ceef7d Fixed bug 3533 - Enumeration joystick devices omitted during directinput enumeration
white.magic

The logic which decides if a device enumerated via the direct input system in the function EnumJoysticksCallback in SDL_dinputjoystick.c is processed is discarding valid joystick devices due to the assumption that devices of the type DI8DEVTYPE_SUPPLEMENTAL are not valid devices.

This change was added with 2.0.4 with this commit http://hg.libsdl.org/SDL/rev/1b9d40126645 that is linked to this bug report https://bugzilla.libsdl.org/show_bug.cgi?id=2460 which indicates that in that case devices of the type DI8DEVTYPE_SUPPLEMENTAL were not desirable as they caused a singular device to emit multiple "device added" events.

Since then there appear to have been a few fixes to handle devices that fall into various other classes in the following two commits:
http://hg.libsdl.org/SDL/rev/10ffb4787d7a and http://hg.libsdl.org/SDL/rev/6a2bbac05728

Two devices I have reports of failing to be listed when the DI8DEVTYPE_SUPPLEMENTAL type is excluded are ECS Gametric Throttle and Thrustmaster MFD Cougar.

Sam Lantinga

I verified that the OUYA controller shows up as a single device with this change, so I've reverted the change to ignore supplemental devices, leaving framework in place to easily add devices that we want to ignore.
2017-01-18 12:18:50 -08:00
Sam Lantinga
45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
6d7da0887d Split controller axes into positive and negative sides so each can be bound independently.
Using this a D-Pad can be mapped to a thumbstick and vice versa.
Also added support for inverted axes, improving trigger binding support
2016-12-27 01:39:07 -08:00
Sam Lantinga
47418f2d5a Updated Windows game controller support 2016-11-11 03:35:37 -08:00
Sam Lantinga
ac74e16cde Standardized the format of the SDL joystick GUID and added functions to retrieve the USB VID/PID from a joystick and game controller. 2016-11-10 17:19:34 -08:00
Sam Lantinga
fa0f417631 Fixed build warnings and errors 2016-10-01 14:48:18 -07:00
Sam Lantinga
64180d2261 Fixed bug 3138 - c_dfDIJoystick2 already defined in dinput8.lib
Machiel van Hooren

In SDL_dxjoystick.c line 349 there is a constant c_dfDIJoystick2.
However, this constant is aparently also defined in dinput8.lib.

I encountered a linking error when statically linking to SDL:
SDL2_static.lib(SDL_dxjoystick.obj) : error LNK2005: _c_dfDIJoystick2 already defined in dinput8.lib
My application is also linking to dinput8.lib because we rolled our own joystick input and are not using the joystick functionality from SDL.
2016-10-01 14:05:35 -07:00
Mikkel Krautz
a21e6af514 Add Xbox One controller GUIDs to the XInput filter in the DirectInput joystick driver.
The Windows 10 Anniversary Update (1607) breaks the method uses that SDL uses to
detect XInput devices. That is, on Windows 10 Anniversary Update, it is no longer
possible to query RAWINPUT for HID devices, and check for "IG_" in the device name.

Presumably, this will be fixed in the future.

This patch works around the issue by adding the Xbox One controller series to the
well-known device list.

This skips the more expensive RAWINPUT check for those devices, and causes them to
be detected as XInput devices once again.
2016-08-06 15:09:20 +02:00
Sam Lantinga
42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann
0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00