GameKit  0.0.1a
C++ gamedev tools
Mouse.hpp
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: Mouse.hpp
5  *
6  * Description:
7  *
8  * Created: 20/12/2014 15:38:51
9  *
10  * Author: Quentin Bazin, <quent42340@gmail.com>
11  *
12  * =====================================================================================
13  */
14 #ifndef GK_MOUSE_HPP_
15 #define GK_MOUSE_HPP_
16 
17 #include "gk/core/Rect.hpp"
18 #include "gk/core/Window.hpp"
19 
20 namespace gk {
21 
22 class Mouse {
23  public:
24  static void resetToWindowCenter();
25 
26  static void setWindow(Window *window) { s_window = window; }
27 
28  static void setCursorVisible(bool isVisible);
29  static void setCursorGrabbed(bool isGrabbed);
30 
31  static Vector2i getPosition();
32 
33  static bool isInRect(const IntRect &rect);
34 
35  private:
36  static Window *s_window;
37 };
38 
39 } // namespace gk
40 
41 #endif // GK_MOUSE_HPP_
static Window * s_window
Definition: Mouse.hpp:36
static void setWindow(Window *window)
Definition: Mouse.hpp:26
static void resetToWindowCenter()
Definition: Mouse.cpp:21
static void setCursorVisible(bool isVisible)
Definition: Mouse.cpp:29
static bool isInRect(const IntRect &rect)
Definition: Mouse.cpp:39
static void setCursorGrabbed(bool isGrabbed)
Definition: Mouse.cpp:25
static Vector2i getPosition()
Definition: Mouse.cpp:33