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