@@ -8,88 +8,87 @@ namespace raylib {
88/* *
99 * Input-related functions: mouse
1010 */
11- class Mouse {
12- public:
11+ namespace Mouse {
1312 /* *
1413 * Detect if a mouse button has been pressed once
1514 */
16- static bool IsButtonPressed (int button) {
15+ [[maybe_unused]] RLCPPAPI inline bool IsButtonPressed (int button) {
1716 return ::IsMouseButtonPressed (button);
1817 }
1918
2019 /* *
2120 * Detect if a mouse button is being pressed
2221 */
23- static bool IsButtonDown (int button) {
22+ [[maybe_unused]] RLCPPAPI inline bool IsButtonDown (int button) {
2423 return ::IsMouseButtonDown (button);
2524 }
2625
2726 /* *
2827 * Detect if a mouse button has been released once
2928 */
30- static bool IsButtonReleased (int button) {
29+ [[maybe_unused]] RLCPPAPI inline bool IsButtonReleased (int button) {
3130 return ::IsMouseButtonReleased (button);
3231 }
3332
34- static bool IsButtonUp (int button) {
33+ [[maybe_unused]] RLCPPAPI inline bool IsButtonUp (int button) {
3534 return ::IsMouseButtonUp (button);
3635 }
3736
38- static int GetX () {
37+ [[maybe_unused]] RLCPPAPI inline int GetX () {
3938 return ::GetMouseX ();
4039 }
4140
42- static int GetY () {
41+ [[maybe_unused]] RLCPPAPI inline int GetY () {
4342 return ::GetMouseY ();
4443 }
4544
46- static void SetX (int x) {
45+ [[maybe_unused]] RLCPPAPI inline void SetX (int x) {
4746 ::SetMousePosition (x, GetY());
4847 }
4948
50- static void SetY (int y) {
49+ [[maybe_unused]] RLCPPAPI inline void SetY (int y) {
5150 ::SetMousePosition (GetX(), y);
5251 }
5352
54- static Vector2 GetPosition () {
53+ [[maybe_unused]] RLCPPAPI inline Vector2 GetPosition () {
5554 return ::GetMousePosition ();
5655 }
5756
58- static void SetPosition (int x, int y) {
57+ [[maybe_unused]] RLCPPAPI inline void SetPosition (int x, int y) {
5958 ::SetMousePosition (x, y);
6059 }
6160
62- static void SetPosition (::Vector2 position) {
61+ [[maybe_unused]] RLCPPAPI inline void SetPosition (::Vector2 position) {
6362 ::SetMousePosition (static_cast <int >(position.x), static_cast<int>(position.y));
6463 }
6564
6665 /* *
6766 * Get mouse delta between frames
6867 */
69- static Vector2 GetDelta () {
68+ [[maybe_unused]] RLCPPAPI inline Vector2 GetDelta () {
7069 return ::GetMouseDelta ();
7170 }
7271
73- static void SetOffset (int offsetX = 0 , int offsetY = 0 ) {
72+ [[maybe_unused]] RLCPPAPI inline void SetOffset (int offsetX = 0 , int offsetY = 0 ) {
7473 ::SetMouseOffset (offsetX, offsetY);
7574 }
7675
77- static void SetOffset (::Vector2 offset) {
76+ [[maybe_unused]] RLCPPAPI inline void SetOffset (::Vector2 offset) {
7877 ::SetMouseOffset (static_cast <int >(offset.x), static_cast<int>(offset.y));
7978 }
8079
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 ) {
8281 ::SetMouseScale (scaleX, scaleY);
8382 }
8483
85- static void SetScale (::Vector2 scale) {
84+ [[maybe_unused]] RLCPPAPI inline void SetScale (::Vector2 scale) {
8685 ::SetMouseScale (scale.x, scale.y);
8786 }
8887
8988 /* *
9089 * Get mouse wheel movement for X or Y, whichever is larger
9190 */
92- static float GetWheelMove () {
91+ [[maybe_unused]] RLCPPAPI inline float GetWheelMove () {
9392 return ::GetMouseWheelMove ();
9493 }
9594
@@ -98,7 +97,7 @@ class Mouse {
9897 *
9998 * @see ::GetMouseWheelMoveV()
10099 */
101- static Vector2 GetWheelMoveV () {
100+ [[maybe_unused]] RLCPPAPI inline Vector2 GetWheelMoveV () {
102101 return GetMouseWheelMoveV ();
103102 }
104103
@@ -107,47 +106,47 @@ class Mouse {
107106 *
108107 * @see ::MouseCursor
109108 */
110- static void SetCursor (int cursor = MOUSE_CURSOR_DEFAULT) {
109+ [[maybe_unused]] RLCPPAPI inline void SetCursor (int cursor = MOUSE_CURSOR_DEFAULT) {
111110 ::SetMouseCursor (cursor);
112111 }
113112
114113 /* *
115114 * Get touch position X for touch point 0 (relative to screen size)
116115 */
117- static int GetTouchX () {
116+ [[maybe_unused]] RLCPPAPI inline int GetTouchX () {
118117 return ::GetTouchX ();
119118 }
120119
121120 /* *
122121 * Get touch position Y for touch point 0 (relative to screen size)
123122 */
124- static int GetTouchY () {
123+ [[maybe_unused]] RLCPPAPI inline int GetTouchY () {
125124 return ::GetTouchY ();
126125 }
127126
128127 /* *
129128 * Get touch position XY for a touch point index (relative to screen size)
130129 */
131- static Vector2 GetTouchPosition (int index) {
130+ [[maybe_unused]] RLCPPAPI inline Vector2 GetTouchPosition (int index) {
132131 return ::GetTouchPosition (index);
133132 }
134133
135134 /* *
136135 * Get a ray trace from mouse position
137136 */
138- static Ray GetRay (::Vector2 mousePosition, const ::Camera& camera) {
137+ [[maybe_unused]] RLCPPAPI inline Ray GetRay (::Vector2 mousePosition, const ::Camera& camera) {
139138 return ::GetMouseRay (mousePosition, camera);
140139 }
141140
142141 /* *
143142 * Get a ray trace from mouse position
144143 */
145- static Ray GetRay (const ::Camera& camera) {
144+ [[maybe_unused]] RLCPPAPI inline Ray GetRay (const ::Camera& camera) {
146145 return ::GetMouseRay (::GetMousePosition (), camera);
147146 }
148147};
149148} // namespace raylib
150149
151- using RMouse = raylib::Mouse;
150+ namespace RMouse = raylib::Mouse;
152151
153152#endif // RAYLIB_CPP_INCLUDE_MOUSE_HPP_
0 commit comments