11 template<class Scalar>
15 constexpr Rect() : x(0), y(0), w(0), h(0) { }
16 constexpr Rect(Vector<Scalar> pos, Vector<Scalar> size)
17 : x(pos.x), y(pos.y), w(size.x), h(size.y) { }
20 constexpr Vector<Scalar> Pos() const { return Vector<Scalar>(x, y); }
21 constexpr Vector<Scalar> Size() const { return Vector<Scalar>(w, h); }
32 /// specialization with same layout as SDL_Rect
38 constexpr Rect() : SDL_Rect({0, 0, 0, 0}) { }
39 constexpr Rect(Vector<int> pos, Vector<int> size)
40 : SDL_Rect({pos.x, pos.y, size.x, size.y}) { }
43 constexpr Vector<int> Pos() const { return Vector<int>(x, y); }
44 constexpr Vector<int> Size() const { return Vector<int>(w, h); }