rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
Public Member Functions | Public Attributes | List of all members
rolmodl::geom::RectXY Struct Reference

Rectangle represented by its top left corner coordinates and its bottom right corner coordinates. More...

#include <Geom.hpp>

Inheritance diagram for rolmodl::geom::RectXY:
rolmodl::DstRectXY rolmodl::SrcRectXY

Public Member Functions

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. More...
 
constexpr RectXY (const SDL_Rect r) noexcept
 Initialize from the given SDL_Rect converted from a width-height rectangle.
 
constexpr RectWH wh () const noexcept
 Convert to an equivalent rolmodl::geom::RectWH.
 
constexpr SDL_Rect sdl () const noexcept
 Convert to an SDL_Rect width-height rectangle.
 

Public Attributes

int x
 
int y
 
int x1
 
int y1
 

Detailed Description

Rectangle represented by its top left corner coordinates and its bottom right corner coordinates.

Has no SDL equivalent.

See also
rolmodl::geom::RectWH::xy

Definition at line 87 of file Geom.hpp.

Constructor & Destructor Documentation

◆ RectXY()

constexpr rolmodl::geom::RectXY::RectXY ( const int  argX,
const int  argY,
const int  argX1,
const int  argY1 
)
inlineconstexprnoexcept

Initialize with the given top left corner x and y, and the bottom right corner x and y.

Todo:
Replace ints with rolmodl::geom::Pos? It's less convenient to initialize

Definition at line 93 of file Geom.hpp.


The documentation for this struct was generated from the following file: