summaryrefslogtreecommitdiff
path: root/src/input_common/sdl/sdl_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common/sdl/sdl_impl.h')
-rw-r--r--src/input_common/sdl/sdl_impl.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h
index 606a32c5b..08044b00d 100644
--- a/src/input_common/sdl/sdl_impl.h
+++ b/src/input_common/sdl/sdl_impl.h
@@ -21,6 +21,8 @@ namespace InputCommon::SDL {
21 21
22class SDLAnalogFactory; 22class SDLAnalogFactory;
23class SDLButtonFactory; 23class SDLButtonFactory;
24class SDLMotionFactory;
25class SDLVibrationFactory;
24class SDLJoystick; 26class SDLJoystick;
25 27
26class SDLState : public State { 28class SDLState : public State {
@@ -50,6 +52,11 @@ public:
50 std::atomic<bool> polling = false; 52 std::atomic<bool> polling = false;
51 Common::SPSCQueue<SDL_Event> event_queue; 53 Common::SPSCQueue<SDL_Event> event_queue;
52 54
55 std::vector<Common::ParamPackage> GetInputDevices() override;
56
57 ButtonMapping GetButtonMappingForDevice(const Common::ParamPackage& params) override;
58 AnalogMapping GetAnalogMappingForDevice(const Common::ParamPackage& params) override;
59
53private: 60private:
54 void InitJoystick(int joystick_index); 61 void InitJoystick(int joystick_index);
55 void CloseJoystick(SDL_Joystick* sdl_joystick); 62 void CloseJoystick(SDL_Joystick* sdl_joystick);
@@ -57,12 +64,17 @@ private:
57 /// Needs to be called before SDL_QuitSubSystem. 64 /// Needs to be called before SDL_QuitSubSystem.
58 void CloseJoysticks(); 65 void CloseJoysticks();
59 66
67 // Set to true if SDL supports game controller subsystem
68 bool has_gamecontroller = false;
69
60 /// Map of GUID of a list of corresponding virtual Joysticks 70 /// Map of GUID of a list of corresponding virtual Joysticks
61 std::unordered_map<std::string, std::vector<std::shared_ptr<SDLJoystick>>> joystick_map; 71 std::unordered_map<std::string, std::vector<std::shared_ptr<SDLJoystick>>> joystick_map;
62 std::mutex joystick_map_mutex; 72 std::mutex joystick_map_mutex;
63 73
64 std::shared_ptr<SDLButtonFactory> button_factory; 74 std::shared_ptr<SDLButtonFactory> button_factory;
65 std::shared_ptr<SDLAnalogFactory> analog_factory; 75 std::shared_ptr<SDLAnalogFactory> analog_factory;
76 std::shared_ptr<SDLVibrationFactory> vibration_factory;
77 std::shared_ptr<SDLMotionFactory> motion_factory;
66 78
67 bool start_thread = false; 79 bool start_thread = false;
68 std::atomic<bool> initialized = false; 80 std::atomic<bool> initialized = false;