XII Release 0.1.0
Loading...
Searching...
No Matches
xiiWindowOutputTargetGAL Class Reference

Creates a swapchain and keeps it up to date with the window. More...

#include <WindowOutputTarget.h>

Inheritance diagram for xiiWindowOutputTargetGAL:
[legend]

Public Types

using OnSwapChainChanged = xiiDelegate<void(xiiSharedPtr<xiiGALSwapChain> pSwapChain, xiiSizeU32 vSize)>
 

Public Member Functions

 xiiWindowOutputTargetGAL (OnSwapChainChanged onSwapChainChanged={})
 
void CreateSwapchain (const xiiGALSwapChainCreationDescription &desc)
 
virtual void PresentImage (bool bEnableVSync) override
 
virtual void AcquireImage () override
 
virtual xiiResult CaptureImage (xiiImage &out_image) override
 

Public Attributes

OnSwapChainChanged m_OnSwapChainChanged
 
xiiSizeU32 m_Size = xiiSizeU32(0, 0)
 
xiiEnum< xiiGALPresentModem_PresentMode
 
xiiGALSwapChainCreationDescription m_CurrentDesc
 
xiiSharedPtr< xiiGALSwapChainm_pSwapChain
 
xiiUniquePtr< xiiGALImageCapturem_pImageCapture
 
xiiUInt32 m_uiCurrentFrame = 0U
 

Detailed Description

Creates a swapchain and keeps it up to date with the window.

If the window is resized or xiiGameApplication::cvar_AppVSync changes and onSwapChainChanged is valid, the swapchain is destroyed and recreated. It is up the the application to respond to the OnSwapChainChanged callback and update any references to the swap-chain, e.g. uses in xiiView or uses as render targets in xiiGALRenderTargetSetup. If onSwapChainChanged is not set, the swapchain will not be re-created and it is up to the application to manage the swapchain and react to window changes.

Member Function Documentation

◆ AcquireImage()

void xiiWindowOutputTargetGAL::AcquireImage ( )
overridevirtual

◆ CaptureImage()

xiiResult xiiWindowOutputTargetGAL::CaptureImage ( xiiImage & out_image)
overridevirtual
Todo
Support depth pitch.

Implements xiiWindowOutputTargetBase.

◆ PresentImage()

void xiiWindowOutputTargetGAL::PresentImage ( bool bEnableVSync)
overridevirtual

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