UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mouse.h
Go to the documentation of this file.
1 #ifndef UGDK_INPUT_MOUSE_H_
2 #define UGDK_INPUT_MOUSE_H_
3 
4 #include <ugdk/system.h>
6 #include <ugdk/math/integer2D.h>
7 #include <set>
8 #include <memory>
9 
10 namespace ugdk {
11 namespace input {
12 
13 class Mouse {
14  public:
15  const math::Integer2D& position() const { return position_; }
16 
17  bool IsDown(const MouseButton&) const;
18  bool IsUp(const MouseButton&) const;
19 
20  bool IsPressed(const MouseButton&) const;
21  bool IsReleased(const MouseButton&) const;
22 
23 
24  private:
25  Mouse();
26  ~Mouse();
27 
28  void Update();
29  const system::SDLEventHandler* event_handler();
30 
31  std::unique_ptr<system::SDLEventHandler> event_handler_;
32  math::Integer2D position_;
33  std::set<MouseButton> state_, state_previous_;
34 
35  friend class Manager;
37 };
38 
39 } // namespace input
40 } // namespace ugdk
41 
42 #endif // UGDK_INPUT_KEYBOARD_H_
bool IsUp(const MouseButton &) const
Definition: mouse.h:13
Definition: integer2D.h:20
bool IsDown(const MouseButton &) const
bool IsReleased(const MouseButton &) const
Definition: animation.h:11
const math::Integer2D & position() const
Definition: mouse.h:15
MouseButton
Definition: mousebutton.h:7
Definition: manager.h:18
friend class MouseInputSDLEventHandler
Definition: mouse.h:36
bool IsPressed(const MouseButton &) const