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

Rectangle represented by its top left corner coordinates, width, and height. More...

#include <Geom.hpp>

Inheritance diagram for rolmodl::geom::RectWH:
rolmodl::DstRectWH rolmodl::SrcRectWH

Public Member Functions

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. More...
 
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 SDL_Rect sdl () const noexcept
 Convert to an SDL_Rect.
 

Public Attributes

int x
 
int y
 
int w
 
int h
 

Detailed Description

Rectangle represented by its top left corner coordinates, width, and height.

See also
https://wiki.libsdl.org/SDL_Rect
rolmodl::geom::RectXY::wh

Definition at line 59 of file Geom.hpp.

Constructor & Destructor Documentation

◆ RectWH()

constexpr rolmodl::geom::RectWH::RectWH ( const int  argX,
const int  argY,
const int  argW,
const int  argH 
)
inlineconstexprnoexcept

Initialize with the given top left corner x and y, width, and height.

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

Definition at line 65 of file Geom.hpp.


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