Skip to content

LiteFX::Rendering::SwapChain

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

Synopsis

Declared in <litefx/rendering.hpp>

template<typename TImageInterface>
requires std::derived_from<TImageInterface, IImage>
class SwapChain
    : public ISwapChain

Base Classes

NameDescription
ISwapChainInterface for a swap chain.

Types

NameDescription
BackBufferSwapEventArgs Event arguments for a ISwapChain::swapped event.
ResetEventArgs Event arguments for a ISwapChain::reseted event.

Type Aliases

Member Functions

NameDescription
~SwapChain [destructor] [virtual]Destructor
addTimingEvent [virtual]Adds a new timing event.
buffers [virtual]Returns the number of images in the swap chain.
device [virtual]Returns the swap chain's parent device instance.
getSurfaceFormats [virtual]Returns an array of supported formats, that can be drawn to the surface.
image image overloads
images [virtual]Returns an array of the swap chain present images.
present [virtual]Queues a present that gets executed after fence has been signaled on the default graphics queue.
readTimingEvent [virtual]Reads the current time stamp value (in ticks) of a timing event.
registerTimingEvent Creates a new instance of a TimingEvent.
renderArea [virtual]Returns the size of the render area.
reset [virtual]Causes the swap chain to be re-created. All frame and command buffers will be invalidated and rebuilt.
resolveQueryId [virtual]Returns the query ID for the timing event.
surfaceFormat [virtual]Returns the swap chain image format.
swapBackBuffer [virtual]Swaps the front buffer with the next back buffer in order.
timingEvent [virtual]Returns the timing event registered for queryId.
timingEvents [virtual]Returns all registered timing events.
verticalSynchronization [virtual]Returns true, if vertical synchronization should be used, otherwise false.

Data Members

NameDescription
reseted Invoked, after the swap chain has been reseted.
swapped Invoked, when the swap chain has swapped the back buffers.

Protected Member Functions

NameDescription
SwapChain [constructor]Constructors
operator= Assignment operators

Template Parameters

NameDescription
TImageInterfaceThe type of the image interface. Must inherit from IImage.

Derived Classes

NameDescription
DirectX12SwapChain Implements a DirectX 12 swap chain.
VulkanSwapChain Implements a Vulkan swap chain.