SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL::Display Class Reference

This is a unique ID for a display for the time it is connected to the system, and is never reused for the lifetime of the application. More...

Public Member Functions

constexpr Display (DisplayID displayID={}) noexcept
 Wraps Display.
constexpr operator DisplayID () const noexcept
 Unwraps to the underlying Display.
PropertiesRef GetProperties () const
 Get the properties associated with a display.
const char * GetName () const
 Get the name of a display in UTF-8 encoding.
Rect GetBounds () const
 Get the desktop area represented by a display.
Rect GetUsableBounds () const
 Get the usable desktop area represented by a display, in screen coordinates.
DisplayOrientation GetNaturalOrientation () const
 Get the orientation of a display when it is unrotated.
DisplayOrientation GetCurrentOrientation () const
 Get the orientation of a display.
float GetContentScale () const
 Get the content scale of a display.
OwnArray< DisplayMode * > GetFullscreenModes () const
 Get a list of fullscreen display modes available on a display.
DisplayMode GetClosestFullscreenMode (const PointRaw &size, float refresh_rate, bool include_high_density_modes) const
 Get the closest match to the requested display mode.
const DisplayMode & GetDesktopMode () const
 Get information about the desktop's display mode.
const DisplayMode & GetCurrentMode () const
 Get information about the current display mode.

Static Public Member Functions

static Display GetPrimary ()
 Return the primary display.
static Display GetForPoint (const PointRaw &point)
 Get the display containing a point.
static Display GetForRect (const RectRaw &rect)
 Get the display primarily containing a rect.

Detailed Description

This is a unique ID for a display for the time it is connected to the system, and is never reused for the lifetime of the application.

If the display is disconnected and reconnected, it will get a new ID.

The value 0 is an invalid ID.

Since
This datatype is available since SDL 3.2.0.

Constructor & Destructor Documentation

◆ Display()

SDL::Display::Display ( DisplayID displayID = {})
inlineconstexprnoexcept

Wraps Display.

Parameters
displayIDthe value to be wrapped

Member Function Documentation

◆ operator DisplayID()

SDL::Display::operator DisplayID ( ) const
inlineconstexprnoexcept

Unwraps to the underlying Display.

Returns
the underlying DisplayID.

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