#include <swap_chain.hpp>
◆ SwapChain() [1/3]
mage::rendering::SwapChain::SwapChain |
( |
ID3D11Device & |
device, |
|
|
ID3D11DeviceContext & |
device_context, |
|
|
NotNull< HWND > |
window, |
|
|
DisplayConfiguration & |
display_configuration |
|
) |
| |
|
explicit |
Constructs a swap chain.
- Parameters
-
[in,out] | device | A reference to the device. |
[in,out] | device_context | A reference to the device context. |
[in] | window | The main window handle. |
[in,out] | display_configuration | A reference to the display configuration. |
◆ SwapChain() [2/3]
mage::rendering::SwapChain::SwapChain |
( |
const SwapChain & |
swap_chain | ) |
|
|
delete |
Constructs a swap chain from the given swap chain.
- Parameters
-
[in] | swap_chain | A reference to a swap chain to copy. |
◆ SwapChain() [3/3]
mage::rendering::SwapChain::SwapChain |
( |
SwapChain && |
swap_chain | ) |
|
|
defaultnoexcept |
Constructs a swap chain by moving the given swap chain.
- Parameters
-
[in] | swap_chain | A reference to a swap chain to move. |
◆ ~SwapChain()
mage::rendering::SwapChain::~SwapChain |
( |
| ) |
|
|
default |
Destructs this swap chain.
◆ Clear()
void mage::rendering::SwapChain::Clear |
( |
| ) |
const |
|
noexcept |
Clears the render target view of the back buffer of this swap chain.
◆ GetRTV()
ID3D11RenderTargetView & mage::rendering::SwapChain::GetRTV |
( |
| ) |
const |
|
noexcept |
Returns the render target view of the back buffer of this swap chain.
- Returns
- A reference to the render target view of the back buffer of this swap chain.
◆ GetWindow()
NotNull< HWND > mage::rendering::SwapChain::GetWindow |
( |
| ) |
|
|
noexcept |
Returns the window handle of this swap chain.
- Returns
- The window handle of this swap chain.
◆ IsFullScreen()
bool mage::rendering::SwapChain::IsFullScreen |
( |
| ) |
const |
|
noexcept |
Checks whether this swap chain displays in full screen mode.
- Returns
true
if this swap chain displays in full screen mode. false
otherwise.
◆ IsWindowed()
bool mage::rendering::SwapChain::IsWindowed |
( |
| ) |
const |
|
noexcept |
Checks whether this swap chain displays in windowed mode.
- Returns
true
if this swap chain displays in windowed mode. false
otherwise.
◆ LostMode()
bool mage::rendering::SwapChain::LostMode |
( |
| ) |
const |
|
noexcept |
Checks whether this swap chain lost its mode, i.e. the tracked mode of this swap chain differs from its actual mode (e.g. ALT + TAB).
- Returns
true
if this swap chain lost its mode. false
otherwise.
◆ operator=() [1/2]
Copies the given swap chain to this swap chain.
- Parameters
-
[in] | swap_chain | A reference to a swap chain to copy. |
- Returns
- A reference to the copy of the given swap chain (i.e. this swap chain).
◆ operator=() [2/2]
Moves the given swap chain to this swap chain.
- Parameters
-
[in] | swap_chain | A reference to a swap chain to move. |
- Returns
- A reference to the moved swap chain (i.e. this swap chain).
◆ Present()
void mage::rendering::SwapChain::Present |
( |
| ) |
const |
|
noexcept |
Presents the back buffer of this swap chain.
◆ SetInitialMode()
void mage::rendering::SwapChain::SetInitialMode |
( |
| ) |
|
Sets the initial mode of this swap chain.
Call this method before starting the game loop.
- Exceptions
-
◆ SwitchMode()
void mage::rendering::SwapChain::SwitchMode |
( |
bool |
toggle | ) |
|
Recreates the swap chain buffers and switches the mode of this swap chain. Windowed mode is switched to full screen mode and vice versa.
- Parameters
-
[in] | toggle | If true , then only the swap chain buffers will be recreated to match the current mode of this swap chain and no mode switch will occurs. If false , then the swap chain buffers will be recreated and a mode switch will occur. |
- Exceptions
-
◆ TakeScreenShot()
void mage::rendering::SwapChain::TakeScreenShot |
( |
const std::wstring & |
fname | ) |
const |
Takes a screenshot of the current back buffer of this swap chain.
- Parameters
-
[in] | fname | A reference to the filename. |
- Exceptions
-
Exception | Failed to take a screenshot of the current back buffer of this swap chain. |
◆ m_impl
A pointer to the implementation of this swap chain.