LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Rendering::SwapChain< TImageInterface > Class Template Referenceabstract

Represents a swap chain, i.e. a chain of multiple IImage instances, that can be presented to a ISurface. More...

#include <rendering.hpp>

Inherits LiteFX::Rendering::ISwapChain.

Public Types

using image_interface_type = TImageInterface
 

Public Member Functions

 ~SwapChain () noexcept override=default
 
virtual const Array< SharedPtr< image_interface_type > > & images () const noexcept=0
 
- Public Member Functions inherited from LiteFX::Rendering::ISwapChain
virtual ~ISwapChain () noexcept=default
 
SharedPtr< const TimingEventregisterTimingEvent (StringView name="")
 Creates a new instance of a TimingEvent.
 
virtual const Array< SharedPtr< const TimingEvent > > & timingEvents () const =0
 Returns all registered timing events.
 
virtual SharedPtr< const TimingEventtimingEvent (UInt32 queryId) const =0
 Returns the timing event registered for queryId .
 
virtual UInt64 readTimingEvent (SharedPtr< const TimingEvent > timingEvent) const =0
 Reads the current time stamp value (in ticks) of a timing event.
 
virtual UInt32 resolveQueryId (SharedPtr< const TimingEvent > timingEvent) const =0
 Returns the query ID for the timing event.
 
virtual const IGraphicsDevicedevice () const =0
 Returns the swap chain's parent device instance.
 
virtual Format surfaceFormat () const noexcept=0
 Returns the swap chain image format.
 
virtual UInt32 buffers () const noexcept=0
 Returns the number of images in the swap chain.
 
virtual const Size2drenderArea () const noexcept=0
 Returns the size of the render area.
 
virtual bool verticalSynchronization () const noexcept=0
 Returns true, if vertical synchronization should be used, otherwise false.
 
virtual IImageimage (UInt32 backBuffer) const =0
 Returns the swap chain present image for backBuffer .
 
virtual const IImageimage () const noexcept=0
 Returns the current swap chain back buffer image.
 
Enumerable< IImage & > images () const
 Returns an array of the swap chain present images.
 
virtual void present (UInt64 fence) const =0
 Queues a present that gets executed after fence has been signaled on the default graphics queue.
 
virtual Enumerable< FormatgetSurfaceFormats () const =0
 Returns an array of supported formats, that can be drawn to the surface.
 
virtual void reset (Format surfaceFormat, const Size2d &renderArea, UInt32 buffers, bool enableVsync=false)=0
 Causes the swap chain to be re-created. All frame and command buffers will be invalidated and rebuilt.
 
virtual UInt32 swapBackBuffer () const =0
 Swaps the front buffer with the next back buffer in order.
 

Protected Member Functions

 SwapChain () noexcept=default
 
 SwapChain (SwapChain &&) noexcept=default
 
 SwapChain (const SwapChain &)=default
 
SwapChainoperator= (SwapChain &&) noexcept=default
 
SwapChainoperator= (const SwapChain &)=default
 
- Protected Member Functions inherited from LiteFX::Rendering::ISwapChain
 ISwapChain () noexcept=default
 
 ISwapChain (ISwapChain &&) noexcept=default
 
 ISwapChain (const ISwapChain &)=default
 
ISwapChainoperator= (const ISwapChain &)=default
 
ISwapChainoperator= (ISwapChain &&) noexcept=default
 

Additional Inherited Members

- Public Attributes inherited from LiteFX::Rendering::ISwapChain
Event< EventArgsswapped
 Invoked, when the swap chain has swapped the back buffers.
 
Event< ResetEventArgsreseted
 Invoked, after the swap chain has been reseted.
 

Detailed Description

template<typename TImageInterface>
requires std::derived_from<TImageInterface, IImage>
class LiteFX::Rendering::SwapChain< TImageInterface >

Represents a swap chain, i.e. a chain of multiple IImage instances, that can be presented to a ISurface.

Template Parameters
TImageInterfaceThe type of the image interface. Must inherit from IImage.

Member Typedef Documentation

◆ image_interface_type

template<typename TImageInterface >
using LiteFX::Rendering::SwapChain< TImageInterface >::image_interface_type = TImageInterface

Constructor & Destructor Documentation

◆ SwapChain() [1/3]

template<typename TImageInterface >
LiteFX::Rendering::SwapChain< TImageInterface >::SwapChain ( )
protecteddefaultnoexcept

◆ SwapChain() [2/3]

template<typename TImageInterface >
LiteFX::Rendering::SwapChain< TImageInterface >::SwapChain ( SwapChain< TImageInterface > && )
protecteddefaultnoexcept

◆ SwapChain() [3/3]

template<typename TImageInterface >
LiteFX::Rendering::SwapChain< TImageInterface >::SwapChain ( const SwapChain< TImageInterface > & )
protecteddefault

◆ ~SwapChain()

template<typename TImageInterface >
LiteFX::Rendering::SwapChain< TImageInterface >::~SwapChain ( )
overridedefaultnoexcept

Member Function Documentation

◆ images()

template<typename TImageInterface >
virtual const Array< SharedPtr< image_interface_type > > & LiteFX::Rendering::SwapChain< TImageInterface >::images ( ) const
pure virtualnoexcept

◆ operator=() [1/2]

template<typename TImageInterface >
SwapChain & LiteFX::Rendering::SwapChain< TImageInterface >::operator= ( const SwapChain< TImageInterface > & )
protecteddefault

◆ operator=() [2/2]

template<typename TImageInterface >
SwapChain & LiteFX::Rendering::SwapChain< TImageInterface >::operator= ( SwapChain< TImageInterface > && )
protecteddefaultnoexcept