趣味で作ってるロボット用ソフトウェア
 All Classes Files Functions Enumerations Enumerator Friends Pages
Joystick_state.h
Go to the documentation of this file.
1 #ifndef HRK_JOYSTICK_STATE_H
2 #define HRK_JOYSTICK_STATE_H
3 
9 #include <SDL.h>
10 #include <memory>
11 
12 
13 namespace hrk
14 {
16  {
17  friend class Input_events;
18 
19  public:
20  explicit Joystick_state(int index, SDL_Joystick* joystick);
21  ~Joystick_state();
22 
23  int index() const;
24  int axis_count() const;
25  int buttons_count() const;
26 
27  short axis_value(int index) const;
28  bool is_button_pressed(int index) const;
29 
30  private:
31  void set_axis_value(int index, short value);
32  void set_is_button_pressed(int index, bool is_pressed);
33 
35  Joystick_state(const Joystick_state& rhs);
36  Joystick_state& operator = (const Joystick_state& rhs);
37 
38  struct pImpl;
39  std::auto_ptr<pImpl> pimpl;
40  };
41 }
42 
43 #endif
Definition: Joystick_state.h:15
Definition: Input_events.h:21