| 
    rolmodl
    
   C++ API for the Simple Directmedia Library 2 (SDL2) 
   | 
 
 
 
 
Go to the documentation of this file.
   12 #include "forwarddecl/Base.hpp" 
   14 #include "forwarddecl/Event.hpp" 
   60     const char* 
name() noexcept;
 
   66     unsigned int ram() noexcept;
 
   74       unsigned int l1Size() noexcept;
 
   81       bool has3DNow() noexcept;
 
   86       bool hasAVX() noexcept;
 
   91       bool hasAVX2() noexcept;
 
   96       bool hasAltiVec() noexcept;
 
  101       bool hasMMX() noexcept;
 
  106       bool hasRDTSC() noexcept;
 
  111       bool hasSSE() noexcept;
 
  116       bool hasSSE2() noexcept;
 
  121       bool hasSSE3() noexcept;
 
  126       bool hasSSE41() noexcept;
 
  131       bool hasSSE42() noexcept;
 
  157           State state() 
const noexcept;
 
  172     namespace clipboard {
 
  175       bool hasText() noexcept;
 
  181       void setText(const 
char* x);
 
  185     namespace screensaver {
 
  188       void enable() noexcept;
 
  191       void disable() noexcept;
 
  194       bool enabled() noexcept;
 
  201       unsigned int count();
 
  207       const char* 
name(
const unsigned int i);
 
  220     namespace display::unsafe {
 
  222       Display 
byIndex(
unsigned int i);
 
  226       unsigned int count();
 
  233       const char* 
name(
const unsigned int i);
 
  263         const char* 
name() 
const noexcept;
 
  274         float ddpi() 
const noexcept;
 
  277         float hdpi() 
const noexcept;
 
  280         float vdpi() 
const noexcept;
 
  283         explicit Display(
const unsigned int i);
 
  288         float ddpi_, hdpi_, vdpi_;
 
  306     namespace display::mode::unsafe {
 
  364       constexpr 
RGB(
const uint8_t arg_r, 
const uint8_t arg_g, 
const uint8_t arg_b) :
 
  365         r(arg_r), g(arg_g), b(arg_b)
 
  386       constexpr 
RGBA(
const uint8_t arg_r, 
const uint8_t arg_g, 
const uint8_t arg_b) :
 
  387         RGB(arg_r, arg_g, arg_b), a(255)
 
  390       constexpr 
RGBA(
const uint8_t arg_r, 
const uint8_t arg_g, 
const uint8_t arg_b, 
const uint8_t arg_a) :
 
  391         RGB(arg_r, arg_g, arg_b), a(arg_a)
 
  408       int code() 
const noexcept;
 
  411       const char* what() 
const noexcept 
override;
 
  448       char* unsafeRaw() noexcept;
 
  450       const char* unsafeRaw() 
const noexcept;
 
  
std::optional< unsigned int > refreshRate
Display mode refresh rate, might be unspecified.
 
geom::Size size
Display mode size.
 
pixelfmt::Id fmt
Display mode format.
 
int throwOnErr(const int code)
Throw a rolmodl::sdlexception if code < 0.
 
constexpr RGBA(const uint8_t arg_r, const uint8_t arg_g, const uint8_t arg_b, const uint8_t arg_a)
Initialize with the given red, green, blue, and alpha values.
 
constexpr RGB(const uint8_t arg_r, const uint8_t arg_g, const uint8_t arg_b)
Initialize with the given red, green, and blue values.
 
const char * name() noexcept
Human-readable OS name. Use rolmodl::sys::id() for OS identification purposes instead of this method.
 
unsigned int logicalCores() noexcept
Get the number of available logical CPU cores.
 
RGBA color type. Has an alpha component.
 
const char * name() const noexcept
Get recorded display name.
 
Display information snapshot.
 
const char * name(const unsigned int i)
Get the name of the ith display. Sample output: XF250Q for my Acer XF250Q. Unsafe because there is no...
 
float ddpi() const noexcept
Get recorded display diagonal DPI (dots per inch).
 
int dimensions data type. The value is in pixels. Semantically different from rolmodl::geom::Pos.
 
Container for SDL-owned strings that must be freed with SDL_free.
 
RGB color type. No alpha component.
 
float vdpi() const noexcept
Get recorded display vertical DPI (dots per inch).
 
SDLString getText()
Get clipboard text contents.
 
DisplayMode currentForDisplayN(unsigned int n)
Get the current display mode for the nth display. Unsafe because there is no bounds checking on the i...
 
Display mode parameter plain old struct.
 
geom::RectWH usableBounds() const noexcept
Get recorded display usable bounds. Excludes system decorations such as the menu bar and the dock.
 
unsigned int ram() noexcept
Get the amount of system RAM in MB.
 
unsigned int count()
Get the number of displays. Unsafe because the return value is unreliable and may lead to out-of-boun...
 
Rectangle represented by its top left corner coordinates, width, and height.
 
geom::RectWH bounds(const unsigned int i)
Get the resolution of the ith display. Unsafe because there is no bounds checking on the index.
 
constexpr RGBA()
Initialize as the default pure opaque black color: RGBA(0, 0, 0, 255) = #000000ff.
 
geom::RectWH usableBounds(const unsigned int i)
Get the bounds of the usable space of the ith display. Excludes system decorations such as the menu b...
 
DisplayMode desktopForDisplayN(unsigned int n)
Get the display mode used by the system desktop for the nth display. Unsafe because there is no bound...
 
System power status snapshot.
 
State
Indicates battery status a.k.a. the system power state.
 
void * unsafeDriverData
Unspecified driver-specific data.
 
unsigned int countForDisplayN(unsigned int n)
Get the amount of display modes available for the nth display.
 
Exception type containing an error code and the last SDL error at the moment of creation.
 
constexpr RGBA(const uint8_t arg_r, const uint8_t arg_g, const uint8_t arg_b)
Initialize with the given red, green, blue values and the default alpha of 255.
 
Display byIndex(unsigned int i)
Get display information for the ith display. Unsafe because there is no bounds checking on the index.
 
DisplayMode closestForDisplayN(unsigned int n, const DisplayMode ideal)
Get the display mode closest to the one specified for the nth display. Unsafe because there is no bou...
 
geom::RectWH bounds() const noexcept
Get recorded display resolution.
 
constexpr RGB()
Initialize as the default pure black color: RGB(0, 0, 0) = #000000.
 
float hdpi() const noexcept
Get recorded display horizontal DPI (dots per inch).
 
DisplayMode forDisplayNByIndexI(unsigned int n, unsigned int i)
Get the ith display mode for the nth display. Unsafe because there is no bounds checking on either in...