The structure that defines a point (using integers).
More...
|
| constexpr | Point (const PointRaw &p={}) noexcept |
| | Wraps Point.
|
| constexpr | Point (int x, int y) noexcept |
| | Constructs from its fields.
|
| constexpr | Point (int v) noexcept |
| | Constructs from its fields.
|
| constexpr | Point (const FPointRaw &p) |
| | Wraps Point.
|
| constexpr | operator bool () const noexcept |
| | Check if valid.
|
| constexpr int | GetX () const noexcept |
| | Get x coordinate.
|
| constexpr Point & | SetX (int newX) noexcept |
| | Set the x coordinate.
|
| constexpr int | GetY () const noexcept |
| | Get y coordinate.
|
| constexpr Point & | SetY (int newY) noexcept |
| | Set the y coordinate.
|
| bool | InRect (const RectRaw &r) const |
| | Determine whether a point resides inside a rectangle.
|
| constexpr Point | operator- () const |
| | Get point's memberwise negation.
|
| constexpr Point & | operator+= (const Point &other) |
| | Memberwise add another point.
|
| constexpr Point & | operator-= (const Point &other) |
| | Memberwise subtract another point.
|
| constexpr Point & | operator/= (const Point &other) |
| | Memberwise divide by another point.
|
| constexpr Point & | operator%= (const Point &other) |
| | Memberwise remainder from division by another point.
|
| constexpr Point & | operator*= (const Point &other) |
| | Memberwise multiply by another point.
|
| constexpr Point | GetClamped (const Rect &rect) const |
| | Get a point with coordinates modified so it fits into a given rect.
|
| constexpr Point & | Clamp (const Rect &rect) |
| | Clamp point coordinates to make it fit into a given rect.
|
| constexpr Point | GetWrapped (const Rect &rect) const |
| | Get a point wrapped within a specified rect.
|
| constexpr Point & | Wrap (const Rect &rect) |
| | Wrap point coordinates within a specified rect.
|
| constexpr | operator FPoint () const |
| | Converts to FPoint.
|
The structure that defines a point (using integers).
Inspired by https://github.com/libSDL2pp/libSDL2pp/blob/master/SDL2pp/Point.hh
- Since
- This struct is available since SDL 3.2.0.
- Category:
- Wrap extending struct
- See also
- GetRectEnclosingPoints
-
PointInRect
◆ Point() [1/4]
| SDL::Point::Point |
( |
const PointRaw & | p = {} | ) |
|
|
inlineconstexprnoexcept |
◆ Point() [2/4]
| SDL::Point::Point |
( |
int | x, |
|
|
int | y ) |
|
inlineconstexprnoexcept |
Constructs from its fields.
- Parameters
-
| x | the value for x. |
| y | the value for y. |
◆ Point() [3/4]
| SDL::Point::Point |
( |
int | v | ) |
|
|
inlineconstexprnoexcept |
Constructs from its fields.
- Parameters
-
◆ Point() [4/4]
◆ Clamp()
| Point & SDL::Point::Clamp |
( |
const Rect & | rect | ) |
|
|
constexpr |
Clamp point coordinates to make it fit into a given rect.
- Parameters
-
| [in] | rect | Rectangle to clamp with |
- Returns
- Reference to self
◆ GetClamped()
| Point SDL::Point::GetClamped |
( |
const Rect & | rect | ) |
const |
|
constexpr |
Get a point with coordinates modified so it fits into a given rect.
- Parameters
-
| [in] | rect | Rectangle to clamp with |
- Returns
- Clamped point
◆ GetWrapped()
| Point SDL::Point::GetWrapped |
( |
const Rect & | rect | ) |
const |
|
constexpr |
Get a point wrapped within a specified rect.
- Parameters
-
| [in] | rect | Rectangle to wrap with |
- Returns
- Wrapped point
◆ GetX()
| int SDL::Point::GetX |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get x coordinate.
- Returns
- x coordinate
◆ GetY()
| int SDL::Point::GetY |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get y coordinate.
- Returns
- y coordinate
◆ operator bool()
| SDL::Point::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexprnoexcept |
Check if valid.
- Returns
- True if valid state, false otherwise.
◆ operator FPoint()
| SDL::Point::operator FPoint |
( |
| ) |
const |
|
constexpr |
◆ operator%=()
| Point & SDL::Point::operator%= |
( |
const Point & | other | ) |
|
|
inlineconstexpr |
Memberwise remainder from division by another point.
- Parameters
-
- Returns
- Reference to self
◆ operator*=()
| Point & SDL::Point::operator*= |
( |
const Point & | other | ) |
|
|
inlineconstexpr |
Memberwise multiply by another point.
- Parameters
-
- Returns
- Reference to self
◆ operator+=()
| Point & SDL::Point::operator+= |
( |
const Point & | other | ) |
|
|
inlineconstexpr |
Memberwise add another point.
- Parameters
-
| [in] | other | Point to add to the current one |
- Returns
- Reference to self
◆ operator-()
| Point SDL::Point::operator- |
( |
| ) |
const |
|
inlineconstexpr |
Get point's memberwise negation.
- Returns
- New Point representing memberwise negation
◆ operator-=()
| Point & SDL::Point::operator-= |
( |
const Point & | other | ) |
|
|
inlineconstexpr |
Memberwise subtract another point.
- Parameters
-
| [in] | other | Point to subtract from the current one |
- Returns
- Reference to self
◆ operator/=()
| Point & SDL::Point::operator/= |
( |
const Point & | other | ) |
|
|
inlineconstexpr |
Memberwise divide by another point.
- Parameters
-
- Returns
- Reference to self
◆ SetX()
| Point & SDL::Point::SetX |
( |
int | newX | ) |
|
|
inlineconstexprnoexcept |
Set the x coordinate.
- Parameters
-
| newX | the new x coordinate. |
- Returns
- Reference to self.
◆ SetY()
| Point & SDL::Point::SetY |
( |
int | newY | ) |
|
|
inlineconstexprnoexcept |
Set the y coordinate.
- Parameters
-
| newY | the new y coordinate. |
- Returns
- Reference to self.
◆ Wrap()
| Point & SDL::Point::Wrap |
( |
const Rect & | rect | ) |
|
|
constexpr |
Wrap point coordinates within a specified rect.
- Parameters
-
| [in] | rect | Rectangle to wrap with |
- Returns
- Reference to self
The documentation for this struct was generated from the following file: