diff options
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 @@ | |||
| 6 | 6 | ||
| 7 | #include <atomic> | 7 | #include <atomic> |
| 8 | #include <memory> | 8 | #include <memory> |
| 9 | #include <mutex> | ||
| 9 | #include <thread> | 10 | #include <thread> |
| 11 | #include <unordered_map> | ||
| 12 | #include "common/common_types.h" | ||
| 10 | #include "common/threadsafe_queue.h" | 13 | #include "common/threadsafe_queue.h" |
| 11 | #include "input_common/sdl/sdl.h" | 14 | #include "input_common/sdl/sdl.h" |
| 12 | 15 | ||
| @@ -16,9 +19,9 @@ using SDL_JoystickID = s32; | |||
| 16 | 19 | ||
| 17 | namespace InputCommon::SDL { | 20 | namespace InputCommon::SDL { |
| 18 | 21 | ||
| 19 | class SDLJoystick; | ||
| 20 | class SDLButtonFactory; | ||
| 21 | class SDLAnalogFactory; | 22 | class SDLAnalogFactory; |
| 23 | class SDLButtonFactory; | ||
| 24 | class SDLJoystick; | ||
| 22 | 25 | ||
| 23 | class SDLState : public State { | 26 | class SDLState : public State { |
| 24 | public: | 27 | public: |
| @@ -31,7 +34,13 @@ public: | |||
| 31 | /// Handle SDL_Events for joysticks from SDL_PollEvent | 34 | /// Handle SDL_Events for joysticks from SDL_PollEvent |
| 32 | void HandleGameControllerEvent(const SDL_Event& event); | 35 | void HandleGameControllerEvent(const SDL_Event& event); |
| 33 | 36 | ||
| 37 | /// Get the nth joystick with the corresponding GUID | ||
| 34 | std::shared_ptr<SDLJoystick> GetSDLJoystickBySDLID(SDL_JoystickID sdl_id); | 38 | std::shared_ptr<SDLJoystick> GetSDLJoystickBySDLID(SDL_JoystickID sdl_id); |
| 39 | |||
| 40 | /** | ||
| 41 | * Check how many identical joysticks (by guid) were connected before the one with sdl_id and so | ||
| 42 | * tie it to a SDLJoystick with the same guid and that port | ||
| 43 | */ | ||
| 35 | std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port); | 44 | std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port); |
| 36 | 45 | ||
| 37 | /// Get all DevicePoller that use the SDL backend for a specific device type | 46 | /// Get all DevicePoller that use the SDL backend for a specific device type |