SPARK
0.1.0
A general purpose game engine written in C++.
|
Vulkan implementation of ISwapChain. More...
#include <VulkanSwapChain.h>
Classes | |
struct | Impl |
Public Member Functions | |
VulkanSwapChain (const VulkanDevice &device, Format surface_format=Format::B8G8R8A8_SRGB, const math::Vector2< unsigned > &render_area={1280, 720}, unsigned buffers=3) | |
Initializes a VulkanSwapChain. | |
VulkanSwapChain (const VulkanSwapChain &other)=delete | |
VulkanSwapChain (VulkanSwapChain &&other) noexcept=delete | |
VulkanSwapChain & | operator= (const VulkanSwapChain &other)=delete |
VulkanSwapChain & | operator= (VulkanSwapChain &&other) noexcept=delete |
const VkSemaphore & | semaphore () const noexcept |
Gets the current swap semaphore, a command queue can wait on for presenting. | |
unsigned | buffers () const noexcept override |
Gets the number of images in the swap chain. | |
math::Vector2< unsigned > | renderArea () const noexcept override |
Gets the swap chain's render area. | |
Format | surfaceFormat () const noexcept override |
Gets the swap chain's surface format. | |
std::vector< Format > | surfaceFormats () const noexcept override |
Gets all the swap chain's supported surface formats. | |
void | reset (Format surface_format, math::Vector2< unsigned > render_area, unsigned buffers) noexcept override |
Recreates the swap chain with the given parameters. All frame buffers that use this swap chain will be invalidated and recreated. | |
unsigned | swapBackBuffer () const noexcept override |
Swaps the front buffer with the next back buffer in order. | |
std::vector< const IVulkanImage * > | images () const noexcept override |
Gets all the swap chain's images. | |
const IVulkanImage * | image (unsigned back_buffer) const override |
Gets the swap chain's current image for the given back buffer. | |
void | present (const VulkanFrameBuffer &frame_buffer) const noexcept override |
Queues a present that gets executed after frame_buffer signals that it's done rendering. | |
![]() | |
virtual void | present (const frame_buffer_type &frame_buffer) const noexcept=0 |
Queues a present that gets executed after frame_buffer signals that it's done rendering. | |
![]() | |
virtual const IImage * | image (unsigned int back_buffer) const =0 |
Gets the swap chain's current image for the given back buffer. | |
std::vector< const IImage * > | images () const noexcept |
Gets all the swap chain's images. | |
void | present (const IFrameBuffer &frame_buffer) const noexcept |
Queues a present that gets executed after frame_buffer signals that it's done rendering. | |
virtual void | reset (Format surface_format, math::Vector2< unsigned int > render_area, unsigned int buffers) noexcept=0 |
Recreates the swap chain with the given parameters. All frame buffers that use this swap chain will be invalidated and recreated. | |
Additional Inherited Members | |
![]() | |
using | image_type |
using | frame_buffer_type |
Vulkan implementation of ISwapChain.
|
explicit |
Initializes a VulkanSwapChain.
device | The device owning the swap chain. |
surface_format | The initial surface format. (default: B8G8R8A8_SRGB) |
render_area | The initial render area. (default: 1280x720) |
buffers | The initial number of buffers. (default: 3) |
|
nodiscardoverridevirtualnoexcept |
Gets the number of images in the swap chain.
Implements spark::render::ISwapChain.
|
nodiscardoverride |
Gets the swap chain's current image for the given back buffer.
back_buffer | Index of the back buffer to get the image for. |
base::ArgumentOutOfRangeException | If back_buffer is out of range. |
|
nodiscardoverridevirtualnoexcept |
Gets all the swap chain's images.
Implements spark::render::SwapChain< IVulkanImage, VulkanFrameBuffer >.
|
overridenoexcept |
Queues a present that gets executed after frame_buffer signals that it's done rendering.
frame_buffer | The frame buffer for which the present should wait. |
|
nodiscardoverridevirtualnoexcept |
Gets the swap chain's render area.
Implements spark::render::ISwapChain.
|
overridenoexcept |
Recreates the swap chain with the given parameters. All frame buffers that use this swap chain will be invalidated and recreated.
There is no guarantee that:
surface_format
. If the format itself is not supported, a compatible format may be looked up. If the lookup fails, the method may raise an exception.buffers
. A swap chain may require a minimum number of images or may constraint a maximum number of images. In both cases, buffers
will be clamped.surface_format | A Format describing the swap chain's surface format. |
render_area | A math::Vector2<unsigned int> describing the swap chain's frame buffers size. |
buffers | The number of buffers in the swap chain. |
|
nodiscardnoexcept |
Gets the current swap semaphore, a command queue can wait on for presenting.
|
nodiscardoverridevirtualnoexcept |
Gets the swap chain's surface format.
Implements spark::render::ISwapChain.
|
nodiscardoverridevirtualnoexcept |
Gets all the swap chain's supported surface formats.
Implements spark::render::ISwapChain.
|
nodiscardoverridevirtualnoexcept |
Swaps the front buffer with the next back buffer in order.
Implements spark::render::ISwapChain.