MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::DisplayConfiguration Class Reference

#include <display_configuration.hpp>

Public Member Functions

 DisplayConfiguration (ComPtr< DXGIAdapter > adapter, ComPtr< DXGIOutput > output, const DXGI_MODE_DESC &display_mode)
 
 DisplayConfiguration (const DisplayConfiguration &configuration)=default
 
 DisplayConfiguration (DisplayConfiguration &&configuration) noexcept=default
 
 ~DisplayConfiguration ()=default
 
DisplayConfigurationoperator= (const DisplayConfiguration &configuration)=default
 
DisplayConfigurationoperator= (DisplayConfiguration &&configuration) noexcept=default
 
DXGIAdapterGetAdapter () const noexcept
 
DXGIOutputGetOutput () const noexcept
 
U32 GetDisplayWidth () const noexcept
 
U32 GetDisplayHeight () const noexcept
 
const U32x2 GetDisplayResolution () const noexcept
 
U32 GetSSDisplayWidth () const noexcept
 
U32 GetSSDisplayHeight () const noexcept
 
const U32x2 GetSSDisplayResolution () const noexcept
 
U32 GetDisplayRoundedRefreshRate () const noexcept
 
const DXGI_RATIONAL GetDisplayRefreshRate () const noexcept
 
DXGI_FORMAT GetDisplayFormat () const noexcept
 
const DXGI_MODE_DESC & GetDisplayMode () const noexcept
 
void SetDisplayMode (const DXGI_MODE_DESC &display_mode) noexcept
 
bool UsesAA () const noexcept
 
bool UsesMSAA () const noexcept
 
bool UsesSSAA () const noexcept
 
AntiAliasing GetAA () const noexcept
 
void SetAA (AntiAliasing aa) noexcept
 
bool IsWindowed () const noexcept
 
void SetWindowed (bool windowed=true) noexcept
 
bool IsFullScreen () const noexcept
 
void SetFullScreen (bool fullscreen=true) noexcept
 
bool IsVSynced () const noexcept
 
void SetVSync (bool vsync=true) noexcept
 

Private Attributes

ComPtr< DXGIAdapterm_adapter
 
ComPtr< DXGIOutputm_output
 
DXGI_MODE_DESC m_display_mode
 
AntiAliasing m_aa
 
bool m_windowed
 
bool m_vsync
 

Detailed Description

A class of display configurations.

Constructor & Destructor Documentation

◆ DisplayConfiguration() [1/3]

mage::rendering::DisplayConfiguration::DisplayConfiguration ( ComPtr< DXGIAdapter adapter,
ComPtr< DXGIOutput output,
const DXGI_MODE_DESC &  display_mode 
)
explicit

Constructs a display configuration.

Precondition
display_mode must be compatible with adapter and output.
Parameters
[in]adapterA pointer to the adapter.
[in]outputA pointer to the output.
[in]display_modeA reference to the display mode.

◆ DisplayConfiguration() [2/3]

mage::rendering::DisplayConfiguration::DisplayConfiguration ( const DisplayConfiguration configuration)
default

Constructs a display configuration from the given display configuration.

Parameters
[in]configurationA reference to a display configuration to copy.

◆ DisplayConfiguration() [3/3]

mage::rendering::DisplayConfiguration::DisplayConfiguration ( DisplayConfiguration &&  configuration)
defaultnoexcept

Constructs a display configuration by moving the given display configuration.

Parameters
[in]configurationA reference to a display configuration to move.

◆ ~DisplayConfiguration()

mage::rendering::DisplayConfiguration::~DisplayConfiguration ( )
default

Destructs this display configuration.

Member Function Documentation

◆ GetAA()

AntiAliasing mage::rendering::DisplayConfiguration::GetAA ( ) const
noexcept

Returns the anti-aliasing mode of this display configuration.

Returns
The anti-aliasing mode of this display configuration.

◆ GetAdapter()

DXGIAdapter* mage::rendering::DisplayConfiguration::GetAdapter ( ) const
noexcept

Returns the adapter of this display configuration.

Returns
A pointer to the adapter of this display configuration.

◆ GetDisplayFormat()

DXGI_FORMAT mage::rendering::DisplayConfiguration::GetDisplayFormat ( ) const
noexcept

Returns the display format of this display configuration.

Returns
The display format of this display configuration.

◆ GetDisplayHeight()

U32 mage::rendering::DisplayConfiguration::GetDisplayHeight ( ) const
noexcept

Returns the display height in pixels of this display configuration.

Returns
The display height in pixels of this display configuration.

◆ GetDisplayMode()

const DXGI_MODE_DESC& mage::rendering::DisplayConfiguration::GetDisplayMode ( ) const
noexcept

Returns the display mode of this display configuration.

Returns
The display mode of this display configuration.

◆ GetDisplayRefreshRate()

const DXGI_RATIONAL mage::rendering::DisplayConfiguration::GetDisplayRefreshRate ( ) const
noexcept

Returns the display refresh rate of this display configuration.

Returns
The display refresh rate of this display configuration.

◆ GetDisplayResolution()

const U32x2 mage::rendering::DisplayConfiguration::GetDisplayResolution ( ) const
noexcept

Returns the display resolution in pixels of this display configuration.

Returns
The display resolution in pixels of this display configuration.

◆ GetDisplayRoundedRefreshRate()

U32 mage::rendering::DisplayConfiguration::GetDisplayRoundedRefreshRate ( ) const
noexcept

Returns the rounded display refresh rate of this display configuration.

Returns
The rounded display refresh rate of this display configuration.

◆ GetDisplayWidth()

U32 mage::rendering::DisplayConfiguration::GetDisplayWidth ( ) const
noexcept

Returns the display width in pixels of this display configuration.

Returns
The display width in pixels of this display configuration.

◆ GetOutput()

DXGIOutput* mage::rendering::DisplayConfiguration::GetOutput ( ) const
noexcept

Returns the output of this display configuration.

Returns
A pointer to the output of this display configuration.

◆ GetSSDisplayHeight()

U32 mage::rendering::DisplayConfiguration::GetSSDisplayHeight ( ) const
noexcept

Returns the super-sampled display height in pixels of this display configuration.

Returns
The super-sampled display height in pixels of this display configuration.

◆ GetSSDisplayResolution()

const U32x2 mage::rendering::DisplayConfiguration::GetSSDisplayResolution ( ) const
noexcept

Returns the super-sampled display resolution in pixels of this display configuration.

Returns
The super-sampled display resolution in pixels of this display configuration.

◆ GetSSDisplayWidth()

U32 mage::rendering::DisplayConfiguration::GetSSDisplayWidth ( ) const
noexcept

Returns the super-sampled display width in pixels of this display configuration.

Returns
The super-sampled display width in pixels of this display configuration.

◆ IsFullScreen()

bool mage::rendering::DisplayConfiguration::IsFullScreen ( ) const
noexcept

Checks whether the application should run in full screen mode for this display configuration.

Returns
true if the application should run in full screen mode for this display configuration. false otherwise.

◆ IsVSynced()

bool mage::rendering::DisplayConfiguration::IsVSynced ( ) const
noexcept

Checks whether V-sync should be enabled for this display configuration.

Returns
true if v-sync should be enabled for this display configuration. false otherwise.

◆ IsWindowed()

bool mage::rendering::DisplayConfiguration::IsWindowed ( ) const
noexcept

Checks whether the application should run in windowed mode for this display configuration.

Returns
true if the application should run in windowed mode for this display configuration. false otherwise.

◆ operator=() [1/2]

DisplayConfiguration& mage::rendering::DisplayConfiguration::operator= ( const DisplayConfiguration configuration)
default

Copies the given display configuration to this display configuration.

Parameters
[in]configurationA reference to a display configuration to copy.
Returns
A reference to the copy of the given display configuration (i.e. this display configuration).

◆ operator=() [2/2]

DisplayConfiguration& mage::rendering::DisplayConfiguration::operator= ( DisplayConfiguration &&  configuration)
defaultnoexcept

Moves the given display configuration to this display configuration.

Parameters
[in]configurationA reference to a display configuration to move.
Returns
A reference to the moved display configuration (i.e. this display configuration).

◆ SetAA()

void mage::rendering::DisplayConfiguration::SetAA ( AntiAliasing  aa)
noexcept

Sets the anti-aliasing mode of this display configuration to the given anti-aliasing mode.

Parameters
[in]aaThe anti-aliasing mode.

◆ SetDisplayMode()

void mage::rendering::DisplayConfiguration::SetDisplayMode ( const DXGI_MODE_DESC &  display_mode)
noexcept

Sets the display mode of this display configuration to the given display mode.

Precondition
display_mode must be compatible with the adapter and output of this display configuration.
Parameters
[in]display_modeA reference to the display mode.

◆ SetFullScreen()

void mage::rendering::DisplayConfiguration::SetFullScreen ( bool  fullscreen = true)
noexcept

Sets the windowed/fullscreen mode of this display configuration to the given windowed/fullscreen mode.

Parameters
[in]fullscreentrue if fullscreen mode. false otherwise.

◆ SetVSync()

void mage::rendering::DisplayConfiguration::SetVSync ( bool  vsync = true)
noexcept

Sets the V-sync mode of this display configuration to the given V-sync mode.

Parameters
[in]vsynctrue if V-sync mode. false otherwise.

◆ SetWindowed()

void mage::rendering::DisplayConfiguration::SetWindowed ( bool  windowed = true)
noexcept

Sets the windowed/fullscreen mode of this display configuration to the given windowed/fullscreen mode.

Parameters
[in]windowedtrue if windowed mode. false otherwise.

◆ UsesAA()

bool mage::rendering::DisplayConfiguration::UsesAA ( ) const
noexcept

Checks whether this display configuration uses AA.

Returns
true if this display configuration uses AA. false otherwise.

◆ UsesMSAA()

bool mage::rendering::DisplayConfiguration::UsesMSAA ( ) const
noexcept

Checks whether this display configuration uses MSAA.

Returns
true if this display configuration uses MSAA. false otherwise.

◆ UsesSSAA()

bool mage::rendering::DisplayConfiguration::UsesSSAA ( ) const
noexcept

Checks whether this display configuration uses SSAA.

Returns
true if this display configuration uses SSAA. false otherwise.

Member Data Documentation

◆ m_aa

AntiAliasing mage::rendering::DisplayConfiguration::m_aa
private

The Anti-Aliasing mode of this display configuration.

◆ m_adapter

ComPtr< DXGIAdapter > mage::rendering::DisplayConfiguration::m_adapter
private

A pointer to the adapter (e.g. video card) of this display configuration.

◆ m_display_mode

DXGI_MODE_DESC mage::rendering::DisplayConfiguration::m_display_mode
private

The display mode of this display configuration.

◆ m_output

ComPtr< DXGIOutput > mage::rendering::DisplayConfiguration::m_output
private

A pointer to the output (e.g. screen monitor) of this display configuration.

◆ m_vsync

bool mage::rendering::DisplayConfiguration::m_vsync
private

Flag indicating whether V-sync should be enabled for this display configuration.

◆ m_windowed

bool mage::rendering::DisplayConfiguration::m_windowed
private

Flag indicating whether the application should run in windowed mode for this display configuration.