Skip to content

Commit 23357ba

Browse files
committed
📝 Update Position related docs
1 parent 50b7ea9 commit 23357ba

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

include/Util/Input.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ class Input {
4545

4646
/**
4747
* @brief Retrieves the current position of the cursor.
48-
* @note The cursor position is relative to the upper-left corner of the
49-
* client area of the window.
5048
*
51-
* @return The cursor position as vec2(x, y).
49+
* @return The cursor position as a PTSDPosition (x, y).
5250
*
5351
* @see Util::Input::SetCursorPosition()
52+
* @see Util::PTSDPosition
5453
*/
5554
static Util::PTSDPosition GetCursorPosition();
5655

@@ -115,11 +114,11 @@ class Input {
115114
/**
116115
* @brief Sets the position of the cursor.
117116
* @param pos The position to set the cursor to.
118-
* @note The cursor position is relative to the upper-left corner of the
119-
* client area of the window.
120-
* @note It also generates a mouse motion event, which leads
121-
* Util::Input::IsMouseMoving() to return true in this update-cycle.
117+
* @note This also triggers a mouse motion event, making Util::Input::IsMouseMoving() return true
118+
* in the current update cycle.
119+
*
122120
* @see Util::Input::GetCursorPosition()
121+
* @see Util::PTSDPosition
123122
*/
124123
static void SetCursorPosition(const Util::PTSDPosition &pos);
125124

include/Util/Position.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ namespace Util {
77

88
struct PTSDPosition;
99

10+
/**
11+
* @class SDLPosition
12+
* @brief A class representing a position in screen coordinates.
13+
*
14+
* This class is used to store the X and Y coordinates of a point in a screen coordinate system where:
15+
* - The origin (0, 0) is at the upper-left corner of the window.
16+
* - X increases to the right.
17+
* - Y increases downwards.
18+
*/
1019
struct SDLPosition {
1120
public:
1221
const int x;
@@ -20,6 +29,15 @@ struct SDLPosition {
2029
y(y) {}
2130
};
2231

32+
/**
33+
* @struct PTSDPosition
34+
* @brief A class representing a position in a Cartesian coordinates.
35+
*
36+
* This class is used to store the X and Y coordinates of a point in a Cartesian coordinate system where:
37+
* - The origin (0, 0) is at the center of the window.
38+
* - X increases to the right.
39+
* - Y increases upwards.
40+
*/
2341
struct PTSDPosition {
2442
float x{};
2543
float y{};

0 commit comments

Comments
 (0)