]> git.tdb.fi Git - libs/gui.git/blob - source/input/gamecontroller.h
baf94cb6c9e437f05422636787111c2b1d57d985
[libs/gui.git] / source / input / gamecontroller.h
1 #ifndef MSP_INPUT_GAMECONTROLLER_H_
2 #define MSP_INPUT_GAMECONTROLLER_H_
3
4 #include <msp/io/eventdispatcher.h>
5 #include <msp/time/timedelta.h>
6 #include "device.h"
7
8 namespace Msp {
9 namespace Input {
10
11 class GameController: public Device
12 {
13 private:
14         struct Private;
15
16         Private *priv = nullptr;
17         IO::EventDispatcher *event_disp = nullptr;
18
19         static bool detect_done;
20         static unsigned n_detected_controllers;
21
22 public:
23         GameController(unsigned);
24         ~GameController();
25
26         static unsigned detect();
27         static bool is_available(unsigned = 0);
28
29         void use_event_dispatcher(IO::EventDispatcher *);
30
31         void tick();
32         void tick(const Time::TimeDelta &);
33 };
34
35 } // namespace Input
36 } // namespace Msp
37
38 #endif