mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -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;
|
||||
}
|
||||
|
||||
Point::Point(const SDL_Point& point) {
|
||||
x = point.x;
|
||||
y = point.y;
|
||||
}
|
||||
|
||||
Point::Point(int nx, int ny) {
|
||||
x = nx;
|
||||
y = ny;
|
||||
|
@ -54,6 +54,14 @@ public:
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
///
|
||||
|
@ -34,6 +34,13 @@ Rect::Rect() {
|
||||
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) {
|
||||
x = nx;
|
||||
y = ny;
|
||||
|
@ -58,6 +58,14 @@ public:
|
||||
////////////////////////////////////////////////////////////
|
||||
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
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user