|
constexpr | Point () |
| Default constructor.
|
|
constexpr | Point (const SDL_Point &point) |
| Construct a point from existing SDL_Point.
|
|
constexpr | Point (int x, int y) |
| Construct the point from given coordinates.
|
|
| Point (const Point &) noexcept=default |
| Copy constructor.
|
|
| Point (Point &&) noexcept=default |
| Move constructor.
|
|
Point & | operator= (const Point &) noexcept=default |
| Assignment operator.
|
|
Point & | operator= (Point &&) noexcept=default |
| Move assignment operator.
|
|
constexpr int | GetX () const |
| Get X coordinate of the point.
|
|
Point & | SetX (int nx) |
| Set X coordinate of the point.
|
|
constexpr int | GetY () const |
| Get Y coordinate of the point.
|
|
Point & | SetY (int ny) |
| Set Y coordinate of the point.
|
|
constexpr Point | operator- () const |
| Get point's memberwise negation.
|
|
constexpr Point | operator+ (const Point &other) const |
| Get point's memberwise addition with another point.
|
|
constexpr Point | operator- (const Point &other) const |
| Get point's memberwise subtraction with another point.
|
|
constexpr Point | operator/ (int value) const |
| Get point's memberwise division by an integer.
|
|
constexpr Point | operator/ (const Point &other) const |
| Get point's memberwise division by another point.
|
|
constexpr Point | operator% (int value) const |
| Get point's memberwise remainder from division by an integer.
|
|
constexpr Point | operator% (const Point &other) const |
| Get point's memberwise remainder from division by another point.
|
|
constexpr Point | operator* (int value) const |
| Get point's memberwise multiplication by an integer.
|
|
constexpr Point | operator* (const Point &other) const |
| Get point's memberwise multiplication by anoter point.
|
|
Point & | operator+= (const Point &other) |
| Memberwise add another point.
|
|
Point & | operator-= (const Point &other) |
| Memberwise subtract another point.
|
|
Point & | operator/= (int value) |
| Memberwise divide by an integer.
|
|
Point & | operator/= (const Point &other) |
|
Point & | operator%= (int value) |
| Memberwise remainder from division by an integer.
|
|
Point & | operator%= (const Point &other) |
| Memberwise remainder from division by another point.
|
|
Point & | operator*= (int value) |
| Memberwise multiply by an integer.
|
|
Point & | operator*= (const Point &other) |
| Memberwise multiply by another point.
|
|
Point | GetClamped (const Rect &rect) const |
| Get a point with coordinates modified so it fits into a given rect.
|
|
Point & | Clamp (const Rect &rect) |
| Clamp point coordinates to make it fit into a given rect.
|
|
Point | GetWrapped (const Rect &rect) const |
| Get a point wrapped within a specified rect.
|
|
Point & | Wrap (const Rect &rect) |
| Wrap point coordinates within a spedified rect.
|
|
2D point
This class is public-derived from SDL_Point structure, may generally used as it if passed via pointer or reference. It also supports direct access to x and y members.
- See also
- http://wiki.libsdl.org/SDL_Point