diff options
author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2019-06-05 15:51:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-05 15:51:03 -0400 |
commit | 6aff1005efc98cd7d1ddab705f041bd60d40f51a (patch) | |
tree | cc3207d49e7a6d4dbefa8f3bcbe638143b29f44c /src/input_common/sdl/sdl_impl.h | |
parent | 2beaaa35c5002f762e82757b8db70a687e4faa7a (diff) | |
parent | 5ccf2a7b822a28364e7e859013342e1b0c9c33d3 (diff) |
Merge pull request #2541 from lioncash/input
input_common/sdl/sdl_impl: Minor cleanup
Diffstat (limited to 'src/input_common/sdl/sdl_impl.h')
-rw-r--r-- | src/input_common/sdl/sdl_impl.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h index 2579741d6..606a32c5b 100644 --- a/src/input_common/sdl/sdl_impl.h +++ b/src/input_common/sdl/sdl_impl.h @@ -6,7 +6,10 @@ #include <atomic> #include <memory> +#include <mutex> #include <thread> +#include <unordered_map> +#include "common/common_types.h" #include "common/threadsafe_queue.h" #include "input_common/sdl/sdl.h" @@ -16,9 +19,9 @@ using SDL_JoystickID = s32; namespace InputCommon::SDL { -class SDLJoystick; -class SDLButtonFactory; class SDLAnalogFactory; +class SDLButtonFactory; +class SDLJoystick; class SDLState : public State { public: @@ -31,7 +34,13 @@ public: /// Handle SDL_Events for joysticks from SDL_PollEvent void HandleGameControllerEvent(const SDL_Event& event); + /// Get the nth joystick with the corresponding GUID std::shared_ptr<SDLJoystick> GetSDLJoystickBySDLID(SDL_JoystickID sdl_id); + + /** + * Check how many identical joysticks (by guid) were connected before the one with sdl_id and so + * tie it to a SDLJoystick with the same guid and that port + */ std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port); /// Get all DevicePoller that use the SDL backend for a specific device type |