![]() |
Fling Engine
0.00.1
Fling Engine is a game engine written in Vulkan
|
Represents a swap chain that can be used throughout the program. More...
#include <SwapChain.h>
Public Member Functions | |
| Swapchain (const VkExtent2D &t_Extent, LogicalDevice *t_Dev, PhysicalDevice *t_PhysDev, VkSurfaceKHR t_Surface) | |
| ~Swapchain () | |
| VkResult | AquireNextImage (const VkSemaphore &t_CompletedSemaphore) |
| VkResult | QueuePresent (const VkQueue &t_PresentQueue, const VkSemaphore &t_WaitSemaphore) |
| void | Recreate (const VkExtent2D &t_Extent) |
| Recreate this swap chain including image views, render passes, and command buffers. More... | |
| void | Cleanup () |
| Cleanup all swapchain resources. More... | |
| const VkSwapchainKHR & | GetVkSwapChain () const |
| const VkPresentModeKHR & | GetPresentMode () const |
| const VkExtent2D & | GetExtents () const |
| const VkFormat & | GetImageFormat () const |
| const std::vector< VkImage > & | GetImages () const |
| const size_t | GetImageCount () const |
| const VkImage & | GetActiveImage () const |
| const UINT32 | GetActiveImageIndex () const |
| const size_t | GetImageViewCount () const |
| const std::vector< VkImageView > & | GetImageViews () const |
Private Member Functions | |
| void | CreateResources () |
| Create any swap chain resources (present mode, KGR swap chain) More... | |
| void | CreateImageViews () |
| Create the image views from the swap chain so that we can actually render them. More... | |
| SwapChainSupportDetails | QuerySwapChainSupport () |
| Check the swap chain support of a given device. More... | |
| VkSurfaceFormatKHR | ChooseSwapChainSurfaceFormat (const std::vector< VkSurfaceFormatKHR > &t_AvailableFormats) |
| Choose a swap chain format based on the available formats. More... | |
| VkPresentModeKHR | ChooseSwapChainPresentMode (const std::vector< VkPresentModeKHR > &t_AvialableFormats) |
| Choose a present mode for the swap chain based on the given formats. More... | |
Private Attributes | |
| VkSwapchainKHR | m_SwapChain = VK_NULL_HANDLE |
| VkPresentModeKHR | m_PresentMode |
| VkExtent2D | m_Extents |
| VkFormat | m_ImageFormat |
| UINT32 | m_ActiveImageIndex {} |
| const LogicalDevice * | m_Device |
| const PhysicalDevice * | m_PhysicalDevice |
| const VkSurfaceKHR | m_Surface |
| std::vector< VkImage > | m_Images |
| The images inside of the swap chain. More... | |
| std::vector< VkImageView > | m_ImageViews |
Represents a swap chain that can be used throughout the program.
|
explicit |
| Fling::Swapchain::~Swapchain | ( | ) |
| VkResult Fling::Swapchain::AquireNextImage | ( | const VkSemaphore & | t_CompletedSemaphore | ) |
|
private |
Choose a present mode for the swap chain based on the given formats.
Prefer VK_PRESENT_MODE_MAILBOX_KHR If none are available, than return VK_PRESENT_MODE_FIFO_KHR or VK_PRESENT_MODE_IMMEDIATE_KHR based on support
| Vector | of available formats |
|
private |
Choose a swap chain format based on the available formats.
Prefer to format that has VK_FORMAT_B8G8R8A8_UNORM and VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, otherwise get the first available.
| Available | swap chain formats |
| void Fling::Swapchain::Cleanup | ( | ) |
Cleanup all swapchain resources.
|
private |
Create the image views from the swap chain so that we can actually render them.
|
private |
Create any swap chain resources (present mode, KGR swap chain)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Check the swap chain support of a given device.
| The | device to check support on |
| VkResult Fling::Swapchain::QueuePresent | ( | const VkQueue & | t_PresentQueue, |
| const VkSemaphore & | t_WaitSemaphore | ||
| ) |
| void Fling::Swapchain::Recreate | ( | const VkExtent2D & | t_Extent | ) |
Recreate this swap chain including image views, render passes, and command buffers.
DOES NOT Clean up any resources.
|
private |
|
private |
|
private |
|
private |
|
private |
The images inside of the swap chain.
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.13