rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
Functions
rolmodl::sys::display::unsafe Namespace Reference

Unsafe display information functions. More...

Functions

Display byIndex (unsigned int i)
 Get display information for the ith display. Unsafe because there is no bounds checking on the index.
 
unsigned int count ()
 Get the number of displays. Unsafe because the return value is unreliable and may lead to out-of-bounds errors if its cached and used for loop iteration. More...
 
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 bounds checking on the index. More...
 
geom::RectWH bounds (const unsigned int i)
 Get the resolution of the ith display. Unsafe because there is no bounds checking on the index. More...
 
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 bar and the dock. Unsafe because there is no bounds checking on the index. More...
 

Detailed Description

Unsafe display information functions.

Function Documentation

◆ count()

unsigned int rolmodl::sys::display::unsafe::count ( )

◆ name()

const char * rolmodl::sys::display::unsafe::name ( const unsigned int  i)

Get the name of the ith display. Sample output: XF250Q for my Acer XF250Q. Unsafe because there is no bounds checking on the index.

In addition to being marked unsafe, the use of this function is further discouraged. Display information should only be acquired all together as a snapshot as done by rolmodl::sys::Display.

See also
https://wiki.libsdl.org/SDL_GetDisplayName

Definition at line 221 of file Base.cpp.

References count().

◆ bounds()

geom::RectWH rolmodl::sys::display::unsafe::bounds ( const unsigned int  i)

Get the resolution of the ith display. Unsafe because there is no bounds checking on the index.

In addition to being marked unsafe, the use of this function is further discouraged. Display information should only be acquired all together as a snapshot as done by rolmodl::sys::Display.

See also
https://wiki.libsdl.org/SDL_GetDisplayBounds

Definition at line 227 of file Base.cpp.

References count(), and rolmodl::detail::throwOnErr().

◆ usableBounds()

geom::RectWH rolmodl::sys::display::unsafe::usableBounds ( const unsigned int  i)

Get the bounds of the usable space of the ith display. Excludes system decorations such as the menu bar and the dock. Unsafe because there is no bounds checking on the index.

In addition to being marked unsafe, the use of this function is further discouraged. Display information should only be acquired all together as a snapshot as done by rolmodl::sys::Display.

See also
https://wiki.libsdl.org/SDL_GetDisplayUsableBounds

Definition at line 236 of file Base.cpp.

References count(), and rolmodl::detail::throwOnErr().