mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-05 20:05:59 -04:00
Add Point/Rect constructors taking SDL_Point/SDL_Rect
This commit is contained in:
parent
057804e814
commit
a1d01e89d4
@ -30,6 +30,11 @@ Point::Point() {
|
|||||||
y = 0;
|
y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Point::Point(const SDL_Point& point) {
|
||||||
|
x = point.x;
|
||||||
|
y = point.y;
|
||||||
|
}
|
||||||
|
|
||||||
Point::Point(int nx, int ny) {
|
Point::Point(int nx, int ny) {
|
||||||
x = nx;
|
x = nx;
|
||||||
y = ny;
|
y = ny;
|
||||||
|
@ -54,6 +54,14 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Point();
|
Point();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Construct a point from existing SDL_Point
|
||||||
|
///
|
||||||
|
/// \param point Existing SDL_Point
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Point(const SDL_Point& point);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Construct the point from given coordinates
|
/// \brief Construct the point from given coordinates
|
||||||
///
|
///
|
||||||
|
@ -34,6 +34,13 @@ Rect::Rect() {
|
|||||||
h = 0;
|
h = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rect::Rect(const SDL_Rect& rect) {
|
||||||
|
x = rect.x;
|
||||||
|
y = rect.y;
|
||||||
|
w = rect.w;
|
||||||
|
h = rect.h;
|
||||||
|
}
|
||||||
|
|
||||||
Rect::Rect(int nx, int ny, int nw, int nh) {
|
Rect::Rect(int nx, int ny, int nw, int nh) {
|
||||||
x = nx;
|
x = nx;
|
||||||
y = ny;
|
y = ny;
|
||||||
|
@ -58,6 +58,14 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Rect();
|
Rect();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Construct a rect from existing SDL_Rect
|
||||||
|
///
|
||||||
|
/// \param rect Existing SDL_Rect
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Rect(const SDL_Rect& rect);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Construct the rect from given corner coordinates, width and height
|
/// \brief Construct the rect from given corner coordinates, width and height
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user