Plasma Engine  2.0
Loading...
Searching...
No Matches
plWindowOutputTargetGAL Class Reference

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

#include <WindowOutputTarget.h>

Inheritance diagram for plWindowOutputTargetGAL:

Public Types

using OnSwapChainChanged = plDelegate<void(plGALSwapChainHandle hSwapChain, plSizeU32 size)>
 

Public Member Functions

 plWindowOutputTargetGAL (OnSwapChainChanged onSwapChainChanged={})
 
void CreateSwapchain (const plGALWindowSwapChainCreationDescription &desc)
 
virtual void PresentImage (bool bEnableVSync) override
 
virtual void AcquireImage () override
 
virtual plResult CaptureImage (plImage &out_image) override
 

Public Attributes

OnSwapChainChanged m_OnSwapChainChanged
 
plSizeU32 m_Size = plSizeU32(0, 0)
 
plGALWindowSwapChainCreationDescription m_currentDesc
 
plGALSwapChainHandle m_hSwapChain
 

Detailed Description

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

If the window is resized or plGameApplication::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 plView or uses as render targets in plGALRenderTargetSetup. 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 plWindowOutputTargetGAL::AcquireImage ( )
overridevirtual

◆ CaptureImage()

plResult plWindowOutputTargetGAL::CaptureImage ( plImage & out_image)
overridevirtual
Todo
Make this more efficient

Implements plWindowOutputTargetBase.

◆ PresentImage()

void plWindowOutputTargetGAL::PresentImage ( bool bEnableVSync)
overridevirtual

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