@@ -8,88 +8,87 @@ namespace raylib {
8
8
/* *
9
9
* Input-related functions: mouse
10
10
*/
11
- class Mouse {
12
- public:
11
+ namespace Mouse {
13
12
/* *
14
13
* Detect if a mouse button has been pressed once
15
14
*/
16
- static bool IsButtonPressed (int button) {
15
+ [[maybe_unused]] RLCPPAPI inline bool IsButtonPressed (int button) {
17
16
return ::IsMouseButtonPressed (button);
18
17
}
19
18
20
19
/* *
21
20
* Detect if a mouse button is being pressed
22
21
*/
23
- static bool IsButtonDown (int button) {
22
+ [[maybe_unused]] RLCPPAPI inline bool IsButtonDown (int button) {
24
23
return ::IsMouseButtonDown (button);
25
24
}
26
25
27
26
/* *
28
27
* Detect if a mouse button has been released once
29
28
*/
30
- static bool IsButtonReleased (int button) {
29
+ [[maybe_unused]] RLCPPAPI inline bool IsButtonReleased (int button) {
31
30
return ::IsMouseButtonReleased (button);
32
31
}
33
32
34
- static bool IsButtonUp (int button) {
33
+ [[maybe_unused]] RLCPPAPI inline bool IsButtonUp (int button) {
35
34
return ::IsMouseButtonUp (button);
36
35
}
37
36
38
- static int GetX () {
37
+ [[maybe_unused]] RLCPPAPI inline int GetX () {
39
38
return ::GetMouseX ();
40
39
}
41
40
42
- static int GetY () {
41
+ [[maybe_unused]] RLCPPAPI inline int GetY () {
43
42
return ::GetMouseY ();
44
43
}
45
44
46
- static void SetX (int x) {
45
+ [[maybe_unused]] RLCPPAPI inline void SetX (int x) {
47
46
::SetMousePosition (x, GetY());
48
47
}
49
48
50
- static void SetY (int y) {
49
+ [[maybe_unused]] RLCPPAPI inline void SetY (int y) {
51
50
::SetMousePosition (GetX(), y);
52
51
}
53
52
54
- static Vector2 GetPosition () {
53
+ [[maybe_unused]] RLCPPAPI inline Vector2 GetPosition () {
55
54
return ::GetMousePosition ();
56
55
}
57
56
58
- static void SetPosition (int x, int y) {
57
+ [[maybe_unused]] RLCPPAPI inline void SetPosition (int x, int y) {
59
58
::SetMousePosition (x, y);
60
59
}
61
60
62
- static void SetPosition (::Vector2 position) {
61
+ [[maybe_unused]] RLCPPAPI inline void SetPosition (::Vector2 position) {
63
62
::SetMousePosition (static_cast <int >(position.x), static_cast<int>(position.y));
64
63
}
65
64
66
65
/* *
67
66
* Get mouse delta between frames
68
67
*/
69
- static Vector2 GetDelta () {
68
+ [[maybe_unused]] RLCPPAPI inline Vector2 GetDelta () {
70
69
return ::GetMouseDelta ();
71
70
}
72
71
73
- static void SetOffset (int offsetX = 0 , int offsetY = 0 ) {
72
+ [[maybe_unused]] RLCPPAPI inline void SetOffset (int offsetX = 0 , int offsetY = 0 ) {
74
73
::SetMouseOffset (offsetX, offsetY);
75
74
}
76
75
77
- static void SetOffset (::Vector2 offset) {
76
+ [[maybe_unused]] RLCPPAPI inline void SetOffset (::Vector2 offset) {
78
77
::SetMouseOffset (static_cast <int >(offset.x), static_cast<int>(offset.y));
79
78
}
80
79
81
- static void SetScale (float scaleX = 1 .0f , float scaleY = 1 .0f ) {
80
+ [[maybe_unused]] RLCPPAPI inline void SetScale (float scaleX = 1 .0f , float scaleY = 1 .0f ) {
82
81
::SetMouseScale (scaleX, scaleY);
83
82
}
84
83
85
- static void SetScale (::Vector2 scale) {
84
+ [[maybe_unused]] RLCPPAPI inline void SetScale (::Vector2 scale) {
86
85
::SetMouseScale (scale.x, scale.y);
87
86
}
88
87
89
88
/* *
90
89
* Get mouse wheel movement for X or Y, whichever is larger
91
90
*/
92
- static float GetWheelMove () {
91
+ [[maybe_unused]] RLCPPAPI inline float GetWheelMove () {
93
92
return ::GetMouseWheelMove ();
94
93
}
95
94
@@ -98,7 +97,7 @@ class Mouse {
98
97
*
99
98
* @see ::GetMouseWheelMoveV()
100
99
*/
101
- static Vector2 GetWheelMoveV () {
100
+ [[maybe_unused]] RLCPPAPI inline Vector2 GetWheelMoveV () {
102
101
return GetMouseWheelMoveV ();
103
102
}
104
103
@@ -107,47 +106,47 @@ class Mouse {
107
106
*
108
107
* @see ::MouseCursor
109
108
*/
110
- static void SetCursor (int cursor = MOUSE_CURSOR_DEFAULT) {
109
+ [[maybe_unused]] RLCPPAPI inline void SetCursor (int cursor = MOUSE_CURSOR_DEFAULT) {
111
110
::SetMouseCursor (cursor);
112
111
}
113
112
114
113
/* *
115
114
* Get touch position X for touch point 0 (relative to screen size)
116
115
*/
117
- static int GetTouchX () {
116
+ [[maybe_unused]] RLCPPAPI inline int GetTouchX () {
118
117
return ::GetTouchX ();
119
118
}
120
119
121
120
/* *
122
121
* Get touch position Y for touch point 0 (relative to screen size)
123
122
*/
124
- static int GetTouchY () {
123
+ [[maybe_unused]] RLCPPAPI inline int GetTouchY () {
125
124
return ::GetTouchY ();
126
125
}
127
126
128
127
/* *
129
128
* Get touch position XY for a touch point index (relative to screen size)
130
129
*/
131
- static Vector2 GetTouchPosition (int index) {
130
+ [[maybe_unused]] RLCPPAPI inline Vector2 GetTouchPosition (int index) {
132
131
return ::GetTouchPosition (index);
133
132
}
134
133
135
134
/* *
136
135
* Get a ray trace from mouse position
137
136
*/
138
- static Ray GetRay (::Vector2 mousePosition, const ::Camera& camera) {
137
+ [[maybe_unused]] RLCPPAPI inline Ray GetRay (::Vector2 mousePosition, const ::Camera& camera) {
139
138
return ::GetMouseRay (mousePosition, camera);
140
139
}
141
140
142
141
/* *
143
142
* Get a ray trace from mouse position
144
143
*/
145
- static Ray GetRay (const ::Camera& camera) {
144
+ [[maybe_unused]] RLCPPAPI inline Ray GetRay (const ::Camera& camera) {
146
145
return ::GetMouseRay (::GetMousePosition (), camera);
147
146
}
148
147
};
149
148
} // namespace raylib
150
149
151
- using RMouse = raylib::Mouse;
150
+ namespace RMouse = raylib::Mouse;
152
151
153
152
#endif // RAYLIB_CPP_INCLUDE_MOUSE_HPP_
0 commit comments