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