rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
|
Unsafe display mode information functions. More...
Functions | |
unsigned int | countForDisplayN (unsigned int n) |
Get the amount of display modes available for the n th display. More... | |
DisplayMode | fromSDL_DisplayMode (const SDL_DisplayMode x) |
DisplayMode | desktopForDisplayN (unsigned int n) |
Get the display mode used by the system desktop for the n th display. Unsafe because there is no bounds checking on the index. More... | |
DisplayMode | currentForDisplayN (unsigned int n) |
Get the current display mode for the n th display. Unsafe because there is no bounds checking on the index. More... | |
DisplayMode | forDisplayNByIndexI (unsigned int n, unsigned int i) |
Get the i th display mode for the n th display. Unsafe because there is no bounds checking on either index. More... | |
DisplayMode | closestForDisplayN (unsigned int n, const DisplayMode ideal) |
Get the display mode closest to the one specified for the n th display. Unsafe because there is no bounds checking on the index and because it will throw if no display is found. More... | |
Unsafe display mode information functions.
unsigned int rolmodl::sys::display::mode::unsafe::countForDisplayN | ( | unsigned int | n | ) |
Get the amount of display modes available for the n
th display.
Unsafe because there is no bounds checking on the index and because the return value is unreliable and may lead to out-of-bounds errors if its cached and used for loop iteration.
Definition at line 284 of file Base.cpp.
References rolmodl::sys::display::unsafe::count(), and countForDisplayN().
Referenced by countForDisplayN(), and forDisplayNByIndexI().
DisplayMode rolmodl::sys::display::mode::unsafe::desktopForDisplayN | ( | unsigned int | n | ) |
Get the display mode used by the system desktop for the n
th display. Unsafe because there is no bounds checking on the index.
Definition at line 304 of file Base.cpp.
References rolmodl::sys::display::unsafe::count(), desktopForDisplayN(), and rolmodl::detail::throwOnErr().
Referenced by desktopForDisplayN().
DisplayMode rolmodl::sys::display::mode::unsafe::currentForDisplayN | ( | unsigned int | n | ) |
Get the current display mode for the n
th display. Unsafe because there is no bounds checking on the index.
Definition at line 313 of file Base.cpp.
References rolmodl::sys::display::unsafe::count(), currentForDisplayN(), and rolmodl::detail::throwOnErr().
Referenced by currentForDisplayN().
DisplayMode rolmodl::sys::display::mode::unsafe::forDisplayNByIndexI | ( | unsigned int | n, |
unsigned int | i | ||
) |
Get the i
th display mode for the n
th display. Unsafe because there is no bounds checking on either index.
Definition at line 322 of file Base.cpp.
References rolmodl::sys::display::unsafe::count(), countForDisplayN(), forDisplayNByIndexI(), and rolmodl::detail::throwOnErr().
Referenced by forDisplayNByIndexI().
DisplayMode rolmodl::sys::display::mode::unsafe::closestForDisplayN | ( | unsigned int | n, |
const DisplayMode | ideal | ||
) |
Get the display mode closest to the one specified for the n
th display. Unsafe because there is no bounds checking on the index and because it will throw if no display is found.
Pixel format and refresh rate default to the system desktop's display mode's if they are not set.
Parameter priority for what is considered "closest": size, pixel format, refresh rate. If all available display modes are too small, returns nullptr
Definition at line 335 of file Base.cpp.
References closestForDisplayN(), rolmodl::sys::display::unsafe::count(), rolmodl::sys::DisplayMode::fmt, std::optional::has_value(), rolmodl::sys::DisplayMode::refreshRate, rolmodl::sys::DisplayMode::size, and rolmodl::sys::DisplayMode::unsafeDriverData.
Referenced by closestForDisplayN().