-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with controller in entry_sdl.cpp. (#3321)
SDL2's concept of GameController is a like a PS or Xbox controller, two sticks, four face buttons, etc. These are the same as the bgfx example's Gamepad. SDL also has a concept of Joystick, which could be anything, like a flight stick. Game Controllers are implemented by these lower level joystick's. Entry SDL gets duplicate events, for both controller and the joystick implementing it. Game controller buttons are remapped to bgfx gamepad, but joystick buttons are not. This causes incorrect button presses. Additionally, the joystick z axis behaves differently than game controller or bgfx gamepad. With at-rest value being negative, not zero. Due to all of this, it seems like the best approach would be to ignore joystick events and only handle game controller events. Also, minor additional fix to get handle's index when using it as array index. Fixes compilation in Visual Studio.
- Loading branch information
1 parent
6f79fe0
commit 74e7edc
Showing
1 changed file
with
8 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters