raylib-cpp
C++ object-oriented wrapper library for raylib.
Mouse.hpp
1 #ifndef RAYLIB_CPP_MOUSE_HPP_
2 #define RAYLIB_CPP_MOUSE_HPP_
3 
4 #ifdef __cplusplus
5 extern "C"{
6 #endif
7 #include "raylib.h"
8 #ifdef __cplusplus
9 }
10 #endif
11 
12 #include "Vector2.hpp"
13 
14 namespace raylib {
15  class Mouse {
16  public:
17  inline bool IsButtonPressed(int button) {
18  return ::IsMouseButtonPressed(button);
19  }
20  inline bool IsButtonDown(int button) {
21  return ::IsMouseButtonDown(button);
22  }
23  inline bool IsButtonReleased(int button) {
24  return ::IsMouseButtonReleased(button);
25  }
26  inline bool IsButtonUp(int button) {
27  return ::IsMouseButtonUp(button);
28  }
29  inline int GetX() {
30  return ::GetMouseX();
31  }
32  inline int GetY() {
33  return ::GetMouseY();
34  }
35  inline Mouse& SetX(int x) {
36  ::SetMouseOffset(x, GetY());
37  return *this;
38  }
39  inline Mouse& SetY(int y) {
40  ::SetMouseOffset(GetX(), y);
41  return *this;
42  }
43  inline Vector2 GetPosition() {
44  return ::GetMousePosition();
45  }
46  inline Mouse& SetPosition(int x, int y) {
47  ::SetMousePosition(x, y);
48  return *this;
49  }
50  inline Mouse& SetOffset(int offsetX, int offsetY) {
51  ::SetMouseOffset(offsetX, offsetY);
52  return *this;
53  }
54  inline Mouse& SetScale(float scaleX, float scaleY) {
55  ::SetMouseScale(scaleX, scaleY);
56  return *this;
57  }
58  inline int GetWheelMove() {
59  return ::GetMouseWheelMove();
60  }
61  inline int GetTouchX() {
62  return ::GetTouchX();
63  }
64  inline int GetTouchY() {
65  return ::GetTouchY();
66  }
67  inline Vector2 GetTouchPosition(int index) {
68  return ::GetTouchPosition(index);
69  }
70  };
71 }
72 
73 #endif
bool IsButtonUp(int button)
Definition: Mouse.hpp:26
bool IsButtonReleased(int button)
Definition: Mouse.hpp:23
int GetY()
Definition: Mouse.hpp:32
Vector2 GetPosition()
Definition: Mouse.hpp:43
bool IsButtonDown(int button)
Definition: Mouse.hpp:20
Mouse & SetY(int y)
Definition: Mouse.hpp:39
Vector2 GetTouchPosition(int index)
Definition: Mouse.hpp:67
Mouse & SetPosition(int x, int y)
Definition: Mouse.hpp:46
int GetX()
Definition: Mouse.hpp:29
bool IsButtonPressed(int button)
Definition: Mouse.hpp:17
int GetWheelMove()
Definition: Mouse.hpp:58
Provides all the classes associated with raylib-cpp.
Definition: AudioDevice.hpp:14
int GetTouchY()
Definition: Mouse.hpp:64
int GetTouchX()
Definition: Mouse.hpp:61
Mouse & SetOffset(int offsetX, int offsetY)
Definition: Mouse.hpp:50
Mouse & SetScale(float scaleX, float scaleY)
Definition: Mouse.hpp:54
Mouse & SetX(int x)
Definition: Mouse.hpp:35