Class SwapChain#
Defined in File SwapChain.h
Inheritance Relationships#
Derived Type#
public TRAP::Graphics::API::VulkanSwapChain
(Class VulkanSwapChain)
Class Documentation#
-
class SwapChain#
Subclassed by TRAP::Graphics::API::VulkanSwapChain
Public Functions
-
virtual ~SwapChain()#
Destructor.
-
virtual std::optional<u32> AcquireNextImage(Semaphore &signalSemaphore, Fence &fence) const = 0#
Acquire the next presentable image from the swapchain to render to.
-
virtual std::optional<u32> AcquireNextImage(Semaphore &signalSemaphore) const = 0#
Acquire the next presentable image from the swapchain to render to.
- Parameters:
signalSemaphore – Semaphore to signal when the image is ready to be presented.
- Returns:
Acquired image index.
-
virtual std::optional<u32> AcquireNextImage(Fence &fence) const = 0#
Acquire the next presentable image from the swapchain to render to.
- Parameters:
fence – Fence to wait for the image to be ready to be presented.
- Returns:
Acquired image index.
-
constexpr const std::vector<TRAP::Ref<RenderTarget>> &GetRenderTargets() const noexcept#
Retrieve the render targets used by the swapchain.
- Returns:
Render targets used by the swapchain.
-
virtual void ToggleVSync() = 0#
Toggle Vsync on and off.
-
virtual void UpdateFramebufferSize() = 0#
Updates the framebuffer size and recreates the swap chain.
Public Static Functions
-
static TRAP::Ref<SwapChain> Create(RendererAPI::SwapChainDesc &desc)#
Create a new swap chain from the given description.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
desc – Swap chain description.
- Returns:
Created swap chain.
Protected Functions
-
SwapChain()#
Constructor.
Protected Attributes
-
std::vector<TRAP::Ref<RenderTarget>> m_renderTargets = {}#
-
virtual ~SwapChain()#