Default mapping for controllers (SDL_GameControllerOpen) |
A Shot in the Dark |
trevor.shawn.williams
|
Haven't run into this problem myself - I have one controller and it's an XBox 360 PC USB model - but since no one has come up with a solution for you yet, I'll give this a shot.
Checkout the SDL2-2.0.3 SDL_gamecontroller.h header file. Specifically, lines 86 - 148. There's a multi-line comment with example code on lines 86 - 110 that explains creating mappings for controllers SDL is unaware of. The rest is a collection of Macros and functions that may be used to actually do it. Don't miss the part about settings hints in the comment. Also, if SDL_IsGameController is throwing errors, it's not exactly mandatory to call it. You can probably work around that crash(?) just by skipping that step. Since you're 100% certain what you have is a controller, you don't need the system to tell you it's a controller. You can probably get away with telling it the device is a controller. Best of luck. |
|||||||||||
|