GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::Display Class Reference

Information about a display on the host system. More...

#include <GREM/graphics/Display.hpp>

Classes

struct  DisplaySentinel
class  DisplayIterator
class  DisplayRange
struct  DisplayModeSentinel
class  DisplayModeIterator
class  DisplayModeRange

Public Types

enum class  Orientation : int32_t {
  UNKNOWN = 0 , LANDSCAPE = 1 , LANDSCAPE_FLIPPED = 2 , PORTRAIT = 3 ,
  PORTRAIT_FLIPPED = 4
}

Public Member Functions

CStringView getName () const
 Get the manufacturer-specified name of the display.
Region2D getBounds () const
 Get the bounds of the display region on the desktop.
Region2D getUsableBounds () const
 Get the bounds of the usable display region on the desktop, which may exclude areas reserved by the system.
Orientation getOrientation () const noexcept
 Get the current orientation of the display.
DisplayMode getDisplayMode () const
 Get the current display mode of this display.
float getContentScale () const
 Get the expected scale for content based on the DPI settings of the display.
DisplayMode getDesktopDisplayMode () const
 Get the display mode of the full desktop.
DisplayModeRange getAvailableFullscreenDisplayModes () const
 Get a list of all available fulscreen display modes for this display.
uint32_t getID () const noexcept
 Get the unique identifier of this display.

Static Public Member Functions

static DisplayRange getAll ()
 Get a list of all available displays.
static Display getPrimary ()
 Get the current primary display.
static Optional< Display > findByID (uint32_t id)
 Get the display with a specific identifier.

Detailed Description

Information about a display on the host system.

Member Enumeration Documentation

◆ Orientation

enum class grem::graphics::Display::Orientation : int32_t
strong
Enumerator
UNKNOWN 

Unknown display orientation.

LANDSCAPE 

Landscape mode, rotated counter-clockwise relative to portrait mode.

LANDSCAPE_FLIPPED 

Landscape mode, rotated clockwise relative to portrait mode.

PORTRAIT 

Portrait mode.

PORTRAIT_FLIPPED 

Portrait mode, upside down.

Member Function Documentation

◆ getAll()

DisplayRange grem::graphics::Display::getAll ( )
staticnodiscard

Get a list of all available displays.

Returns
a read-only range containing all currently available displays.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ getPrimary()

Display grem::graphics::Display::getPrimary ( )
staticnodiscard

Get the current primary display.

Returns
information about the current primary display.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ findByID()

Optional< Display > grem::graphics::Display::findByID ( uint32_t id)
staticnodiscard

Get the display with a specific identifier.

Parameters
ididentifier to get the display of.
Returns
the display with the given identifier, or an empty optional if no display with the given identifier exists.

◆ getName()

CStringView grem::graphics::Display::getName ( ) const
nodiscard

Get the manufacturer-specified name of the display.

Returns
a read-only view over a UTF-8-encoded string containing the name of the display.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ getBounds()

Region2D grem::graphics::Display::getBounds ( ) const
nodiscard

Get the bounds of the display region on the desktop.

Returns
a rectangle representing the display's position and size on the desktop.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ getUsableBounds()

Region2D grem::graphics::Display::getUsableBounds ( ) const
nodiscard

Get the bounds of the usable display region on the desktop, which may exclude areas reserved by the system.

Returns
a rectangle representing the display's usable position and size on the desktop.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ getOrientation()

Orientation grem::graphics::Display::getOrientation ( ) const
nodiscardnoexcept

Get the current orientation of the display.

Returns
the orientation of the display, or Orientation::UNKNOWN if unavailable.

◆ getDisplayMode()

DisplayMode grem::graphics::Display::getDisplayMode ( ) const
nodiscard

Get the current display mode of this display.

Returns
the current display mode of this display.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ getContentScale()

float grem::graphics::Display::getContentScale ( ) const
nodiscard

Get the expected scale for content based on the DPI settings of the display.

Returns
the content scale of this display.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ getDesktopDisplayMode()

DisplayMode grem::graphics::Display::getDesktopDisplayMode ( ) const
nodiscard

Get the display mode of the full desktop.

Returns
a display mode representing the full desktop for this display.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ getAvailableFullscreenDisplayModes()

DisplayModeRange grem::graphics::Display::getAvailableFullscreenDisplayModes ( ) const
nodiscard

Get a list of all available fulscreen display modes for this display.

Returns
a read-only range containing all available fullscreen display modes for this display.
Exceptions
graphics::Erroron failure.
std::bad_allocon allocation failure.

◆ getID()

uint32_t grem::graphics::Display::getID ( ) const
nodiscardnoexcept

Get the unique identifier of this display.

Returns
the identifier corresponding to this display.

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