|
evan 2026.1.4
Evan
|
A swapchain image implementation for desktop platforms using GLFW. More...
#include <headers/evan/glfw/DesktopSwapchainImage.hpp>


Public Member Functions | |
| DesktopSwapchainImage (const DeviceContext &deviceContext, GLFWwindow *window, VkRenderPass renderpass, VkSwapchainKHR oldSwapchain=VK_NULL_HANDLE) | |
| Constructs a DesktopSwapchainImage instance for a given device context, GLFW window, and render pass. | |
| void | destroy (VkDevice device) override |
| Destroys the swapchain image and releases associated resources. | |
| void | fillPresentInfo (VkPresentInfoKHR &presentInfo) const override |
| Fills the VkPresentInfoKHR structure with the necessary information for presenting the swapchain image. | |
Public Member Functions inherited from evan::ASwapchainImage | |
| VkFramebuffer | getFramebuffer (uint32_t index) const |
| Retrieves the Vulkan framebuffer associated with the swapchain image at the specified index. | |
| VkExtent2D | getExtent () const |
| Retrieves the extent (width and height) of the swapchain images. | |
| uint32_t | getFramebufferCount () const |
| Retrieves the number of framebuffers associated with the swapchain images. | |
Public Attributes | |
| VkSwapchainKHR | _swapchain = VK_NULL_HANDLE |
A swapchain image implementation for desktop platforms using GLFW.
This class manages the creation and presentation of swapchain images for a GLFW window. It handles the selection of surface formats, present modes, and swap extents based on the capabilities of the physical device and the window properties.
The DesktopSwapchainImage class inherits from ASwapchainImage and implements the necessary functionality to create and manage a Vulkan swapchain for a desktop application. It provides methods to destroy the swapchain and fill presentation information for presenting images to the screen.
Definition at line 34 of file DesktopSwapchainImage.hpp.
| evan::DesktopSwapchainImage::DesktopSwapchainImage | ( | const DeviceContext & | deviceContext, |
| GLFWwindow * | window, | ||
| VkRenderPass | renderpass, | ||
| VkSwapchainKHR | oldSwapchain = VK_NULL_HANDLE |
||
| ) |
Constructs a DesktopSwapchainImage instance for a given device context, GLFW window, and render pass.
This constructor initializes the swapchain image by creating a Vulkan swapchain based on the provided device context, GLFW window, and render pass. It selects appropriate surface formats, present modes, and swap extents to ensure optimal performance and compatibility with the rendering pipeline.
| deviceContext | The device context containing the Vulkan device and related resources needed for swapchain creation. |
| window | The GLFW window for which the swapchain image is being created. The window properties are used to determine the swap extent and other parameters for the swapchain. |
| renderpass | The Vulkan render pass that will be used with the swapchain images during rendering operations. The render pass defines the attachments and subpasses that will be used when rendering to the swapchain images. |
| oldSwapchain | The previous swapchain to retire when recreating, or VK_NULL_HANDLE for the initial creation. |
Definition at line 17 of file DesktopSwapchainImage.cpp.

| evan::DesktopSwapchainImage::~DesktopSwapchainImage | ( | ) |
Definition at line 139 of file DesktopSwapchainImage.cpp.
Destroys the swapchain image and releases associated resources.
This function overrides the pure virtual destroy method from ASwapchainImage to handle the specific logic for destroying the Vulkan swapchain and releasing any resources associated with it. It takes a Vulkan device as a parameter, which is used to perform the necessary cleanup operations for the swapchain.
| device | The Vulkan device used to perform the cleanup operations for the swapchain image. This device is typically obtained from the device context and is used to destroy the swapchain and release associated resources. |
Implements evan::ASwapchainImage.
Definition at line 149 of file DesktopSwapchainImage.cpp.
|
overridevirtual |
Fills the VkPresentInfoKHR structure with the necessary information for presenting the swapchain image.
This function overrides the pure virtual fillPresentInfo method from ASwapchainImage to populate the VkPresentInfoKHR structure with the appropriate information required for presenting the swapchain image to the screen. It takes a reference to a VkPresentInfoKHR structure as a parameter, which should be filled with the necessary details such as the swapchain, image index, and synchronization primitives.
| presentInfo | A reference to a VkPresentInfoKHR structure that should be filled with the necessary information for presenting the swapchain image. This structure is used by the rendering system to present rendered frames using the swapchain images, and it must be correctly populated to ensure proper presentation behavior. |
Implements evan::ASwapchainImage.
Definition at line 225 of file DesktopSwapchainImage.cpp.
| VkSwapchainKHR evan::DesktopSwapchainImage::_swapchain = VK_NULL_HANDLE |
The Vulkan swapchain associated with this swapchain image. The swapchain is created during the initialization of the DesktopSwapchainImage instance and is used for presenting rendered images to the screen. It is important to properly manage the lifecycle of the swapchain, ensuring that it is destroyed when no longer needed to release associated resources.
Definition at line 131 of file DesktopSwapchainImage.hpp.