KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::FVulkanSwapChain Class Reference

Represents a Vulkan swapchain, managing the images used for rendering and presentation. More...

#include <VulkanSwapChain.h>

Public Member Functions

void Destroy (FVulkanSwapChainRecreateInfo *RecreateInfo)
 Destroys the swapchain appropriately.
VkSwapchainKHR GetSwapChainHandle () const
VkExtent2D GetSwapChainExtent () const
uint32_t GetMaxFramesInFlight () const
const std::vector< VkImage > & GetSwapChainImages () const
const std::vector< VkImageView > & GetSwapChainImageViews () const
VkFormat GetSwapChainImageFormat () const

Static Public Member Functions

static FVulkanSwapChain * Create (FVulkanDevice *InDevice)
 Creates a Vulkan swapchain based on the provided device.

Protected Attributes

const VkInstance m_Instance
FVulkanDevicem_Device
VkSurfaceKHR m_Surface = VK_NULL_HANDLE
VkSwapchainKHR m_SwapChain = VK_NULL_HANDLE
std::vector< VkImage > m_SwapChainImages
std::vector< VkImageView > m_SwapChainImageViews
VkFormat m_SwapChainImageFormat
VkExtent2D m_SwapChainExtent
VkSurfaceFormatKHR m_SurfaceFormat
VkPresentModeKHR m_PresentMode
GLFWwindow * m_WindowHandle
uint32_t m_InternalWidth = 0
uint32_t m_InternalHeight = 0
bool bInternalFullScreen = false
uint32_t m_CurrentImageIndex
uint32_t m_SemaphoreIndex
const uint32_t MAX_FRAMES_IN_FLIGHT = 4

Detailed Description

Represents a Vulkan swapchain, managing the images used for rendering and presentation.

A swapchain is a series of images that are presented to the screen in a specific order. It is a crucial component in Vulkan for rendering graphics to a window. Since there is not default framebuffer in Vulkan, the swapchain provides the images that will be used as the framebuffer for rendering.

Since
Karma 1.0.0

Member Function Documentation

◆ Create()

FVulkanSwapChain * Karma::FVulkanSwapChain::Create ( FVulkanDevice * InDevice)
static

Creates a Vulkan swapchain based on the provided device.

Parameters
InDeviceThe FVulkanDevice containing the LogicalDevice and GPU
See also
KarmaGuiVulkanHandler::FillWindowData
Since
Karma 1.0.0

◆ Destroy()

void Karma::FVulkanSwapChain::Destroy ( FVulkanSwapChainRecreateInfo * RecreateInfo)

Destroys the swapchain appropriately.

Parameters
RecreateInfoInformation required to recreate the swapchain
Note
m_SwapChainImages are cleared automatically when vkDestroySwapchainKHR is called
Since
Karma 1.0.0

The documentation for this class was generated from the following files: