|
SDL3pp
A slim C++ wrapper for SDL3
|
The structure that defines a point (using integers). More...


Public Member Functions | |
| constexpr | Point (const PointRaw &p={}) |
| Wraps Point. More... | |
| constexpr | Point (int x, int y) |
| Constructs from its fields. More... | |
| constexpr | Point (const FPointRaw &p) |
| Wraps Point. More... | |
| constexpr | operator bool () const |
| Check if valid. More... | |
| constexpr int | GetX () const |
| Get x coordinate. More... | |
| constexpr Point & | SetX (int newX) |
| Set the x coordinate. More... | |
| constexpr int | GetY () const |
| Get y coordinate. More... | |
| constexpr Point & | SetY (int newY) |
| Set the y coordinate. More... | |
| constexpr bool | InRect (const RectRaw &r) const |
| Determine whether a point resides inside a rectangle. More... | |
| constexpr Point | operator- () const |
| Get point's memberwise negation. More... | |
| constexpr Point | operator+ (const Point &other) const |
| Get point's memberwise addition with another point. More... | |
| constexpr Point | operator- (const Point &other) const |
| Get point's memberwise subtraction with another point. More... | |
| constexpr Point | operator/ (int value) const |
| Get point's memberwise division by an integer. More... | |
| constexpr FPoint | operator/ (float value) const |
| Get point's memberwise division by an integer. More... | |
| constexpr Point | operator/ (const Point &other) const |
| Get point's memberwise division by another point. More... | |
| constexpr Point | operator% (int value) const |
| Get point's memberwise remainder from division by an integer. More... | |
| constexpr Point | operator% (const Point &other) const |
| Get point's memberwise remainder from division by another point. More... | |
| constexpr Point | operator* (int value) const |
| Get point's memberwise multiplication by an integer. More... | |
| constexpr FPoint | operator* (float value) const |
| Get point's memberwise multiplication by an integer. More... | |
| constexpr Point | operator* (const Point &other) const |
| Get point's memberwise multiplication by another point. More... | |
| constexpr Point & | operator+= (const Point &other) |
| Memberwise add another point. More... | |
| constexpr Point & | operator-= (const Point &other) |
| Memberwise subtract another point. More... | |
| constexpr Point & | operator/= (int value) |
| Memberwise divide by an integer. More... | |
| constexpr Point & | operator/= (const Point &other) |
| Memberwise divide by another point. More... | |
| constexpr Point & | operator%= (int value) |
| Memberwise remainder from division by an integer. More... | |
| constexpr Point & | operator%= (const Point &other) |
| Memberwise remainder from division by another point. More... | |
| constexpr Point & | operator*= (int value) |
| Memberwise multiply by an integer. More... | |
| constexpr Point & | operator*= (const Point &other) |
| Memberwise multiply by another point. More... | |
| constexpr Point | GetClamped (const Rect &rect) const |
| Get a point with coordinates modified so it fits into a given rect. More... | |
| constexpr Point & | Clamp (const Rect &rect) |
| Clamp point coordinates to make it fit into a given rect. More... | |
| constexpr Point | GetWrapped (const Rect &rect) const |
| Get a point wrapped within a specified rect. More... | |
| constexpr Point & | Wrap (const Rect &rect) |
| Wrap point coordinates within a specified rect. More... | |
| constexpr | operator FPoint () const |
| Converts to FPoint. More... | |
Inspired by https://github.com/libSDL2pp/libSDL2pp/blob/master/SDL2pp/Point.hh
|
inlineconstexpr |
| p | the value to be wrapped |
|
inlineconstexpr |
| x | the value for x. |
| y | the value for y. |
|
inlineexplicitconstexpr |
| p | the value to be wrapped |
| [in] | rect | Rectangle to clamp with |
| [in] | rect | Rectangle to clamp with |
| [in] | rect | Rectangle to wrap with |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineexplicitconstexpr |
| [in] | other | Divisor |
|
inlineconstexpr |
| [in] | value | Divisor |
| [in] | other | Divisor |
|
inlineconstexpr |
| [in] | value | Divisor |
| [in] | other | Multiplier |
|
constexpr |
| [in] | value | Multiplier |
|
inlineconstexpr |
| [in] | value | Multiplier |
| [in] | other | Multiplier |
|
inlineconstexpr |
| [in] | value | Multiplier |
| [in] | other | Point to add to the current one |
|
inlineconstexpr |
| [in] | other | Point to subtract from the current one |
| [in] | other | Divisor |
|
constexpr |
| [in] | value | Divisor |
|
inlineconstexpr |
| [in] | value | Divisor |
| [in] | other | Divisor |
|
inlineconstexpr |
| [in] | value | Divisor |
|
inlineconstexpr |
| newX | the new x coordinate. |
|
inlineconstexpr |
| newY | the new y coordinate. |
| [in] | rect | Rectangle to wrap with |