rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
|
Go to the documentation of this file.
8 #include "forwarddecl/Geom.hpp"
65 constexpr
RectWH(
const int argX,
const int argY,
const int argW,
const int argH) noexcept :
66 x(argX), y(argY), w(argW), h(argH)
69 constexpr
explicit RectWH(
const SDL_Rect r) noexcept :
70 x(r.x), y(r.y), w(r.w), h(r.h)
74 constexpr
RectXY xy() const noexcept;
76 constexpr SDL_Rect
sdl() const noexcept {
77 return SDL_Rect{x, y, w, h};
93 constexpr
RectXY(
const int argX,
const int argY,
const int argX1,
const int argY1) noexcept :
94 x(argX), y(argY), x1(argX1), y1(argY1)
97 constexpr
explicit RectXY(
const SDL_Rect r) noexcept :
102 constexpr
RectWH wh() const noexcept;
104 constexpr SDL_Rect
sdl() const noexcept {
112 return RectXY(x, y, x+w, y+h);
115 return RectWH(x, y, x1-x, y1-y);
float point data type. Used by touch events.
constexpr SDL_Rect sdl() const noexcept
Convert to an SDL_Rect.
int32 point data type. The value is in pixels. Used by mouse events.
int dimensions data type. The value is in pixels. Semantically different from rolmodl::geom::Pos.
constexpr RectWH(const SDL_Rect r) noexcept
Initialize from the given SDL_Rect.
constexpr RectXY xy() const noexcept
Convert to an equivalent rolmodl::geom::RectXY.
constexpr RectWH(const int argX, const int argY, const int argW, const int argH) noexcept
Initialize with the given top left corner x and y, width, and height.
Rectangle represented by its top left corner coordinates and its bottom right corner coordinates.
Rectangle represented by its top left corner coordinates, width, and height.
constexpr RectWH wh() const noexcept
Convert to an equivalent rolmodl::geom::RectWH.
constexpr RectXY(const int argX, const int argY, const int argX1, const int argY1) noexcept
Initialize with the given top left corner x and y, and the bottom right corner x and y.
constexpr SDL_Rect sdl() const noexcept
Convert to an SDL_Rect width-height rectangle.
int point data type. The value is in pixels. Semantically different from rolmodl::geom::Size.
constexpr RectXY(const SDL_Rect r) noexcept
Initialize from the given SDL_Rect converted from a width-height rectangle.