ce16653cc8
* Implement the basics of controller auto mapping. From testing doesn't currenlty work. Opening the controller requires the device index, but it is only known and guaranteed at boot time or when a controller is connected. * Use the SDL_INIT_GAMECONTROLLER flag to initialize the controller subsystem. It automatically initializes the joystick subsystem too, so SDL_INIT_JOYSTICK is not needed. * Implement the SDLGameController class to handle open game controllers. Based on the SDLJoystick implementation. * Address review comments * Changes SDLJoystick and SDLGameController to use a custom default constructible destructor, to improve readability. The only deleters used previously were SDL_JoystickClose and SDL_GameControllerClose, respectively, plus null lambdas. Given that both SDL functions accept null pointers with just an early return, this should be functionally the same. with just an early return * warn the user when a controller mapping is not found * Get axis direction and threshold from SDL_ExtendedGameControllerBind * Reject analog bind if it's not axis, for the couple of examples present in SDL2.0.10's db. Also add SDL_CONTROLLER_BINDTYPE_NONE for the button bind switch, with a better log message. * sdl_impl.cpp: Log the error returned by SDL_GetError upon failure to open joystick * sdl: only use extended binding on SDL2.0.6 and up * sdl_impl.cpp: minor changes |
||
---|---|---|
.. | ||
sdl | ||
udp | ||
analog_from_button.cpp | ||
analog_from_button.h | ||
CMakeLists.txt | ||
keyboard.cpp | ||
keyboard.h | ||
main.cpp | ||
main.h | ||
motion_emu.cpp | ||
motion_emu.h | ||
touch_from_button.cpp | ||
touch_from_button.h |