|
evan 2026.1.4
Evan
|
Represents a swapchain image for OpenXR rendering. More...
#include <headers/evan/openxr/XrSwapchainImage.hpp>


Classes | |
| struct | CreateXrSwapchainImageProperties |
| Encapsulates properties for creating an XrSwapchainImage instance. More... | |
Public Member Functions | |
| XrSwapchainImage (const CreateXrSwapchainImageProperties &properties) | |
| Constructs an XrSwapchainImage instance using the provided properties. | |
| ~XrSwapchainImage () override | |
| Releases the swapchain image resources if they were not already destroyed through destroy(). | |
| void | destroy (VkDevice device) override |
| Destroys the swapchain images and releases associated resources. | |
| void | fillPresentInfo (VkPresentInfoKHR &presentInfo) const override |
| Fills the VkPresentInfoKHR structure with the necessary information for presenting the swapchain images. | |
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 | |
| XrSwapchain | _swapchain = XR_NULL_HANDLE |
| uint32_t | _width = 0 |
| uint32_t | _height = 0 |
Represents a swapchain image for OpenXR rendering.
This class encapsulates the functionality for managing swapchain images in the context of OpenXR rendering. It inherits from ASwapchainImage and provides implementations for destroying the swapchain images and filling presentation information. The class holds a reference to the OpenXR swapchain handle, the dimensions of the swapchain images, and a vector of Vulkan swapchain image structures. It also includes a structure for encapsulating properties required for creating an instance of XrSwapchainImage, which includes the OpenXR swapchain handle, swapchain creation info, Vulkan render pass, and a reference to the device context.
Definition at line 38 of file XrSwapchainImage.hpp.
| evan::XrSwapchainImage::XrSwapchainImage | ( | const CreateXrSwapchainImageProperties & | properties | ) |
Constructs an XrSwapchainImage instance using the provided properties.
This constructor initializes the XrSwapchainImage by creating Vulkan image views for each swapchain image based on the provided OpenXR swapchain handle and creation info. It also sets up the necessary resources for rendering operations, such as determining the dimensions of the swapchain images and storing references to the Vulkan render pass and device context for later use in rendering and presentation operations.
| properties | A structure containing all necessary properties for initializing the XrSwapchainImage, including the OpenXR swapchain handle, swapchain creation info, Vulkan render pass, and a reference to the device context. |
Definition at line 10 of file XrSwapchainImage.cpp.

|
override |
Releases the swapchain image resources if they were not already destroyed through destroy().
Definition at line 71 of file XrSwapchainImage.cpp.
Destroys the swapchain images and releases associated resources.
This function overrides the pure virtual function from ASwapchainImage to handle the destruction of the swapchain images and the release of any resources associated with them. It takes a Vulkan device as a parameter, which is used to perform the necessary cleanup operations, such as destroying image views and freeing memory. Implement this function to ensure that all resources related to the swapchain images are properly released when they are no longer needed.
| device | The Vulkan device used to perform the cleanup operations for the swapchain images. |
Implements evan::ASwapchainImage.
Definition at line 77 of file XrSwapchainImage.cpp.
|
overridevirtual |
Fills the VkPresentInfoKHR structure with the necessary information for presenting the swapchain images.
This function overrides the pure virtual function from ASwapchainImage to populate the VkPresentInfoKHR structure with the appropriate information required for presenting the swapchain images 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. Implement this function to ensure that the rendering system can correctly present rendered frames using the swapchain images.
| presentInfo | A reference to a VkPresentInfoKHR structure that should be filled with the necessary information for presenting the swapchain images. |
Implements evan::ASwapchainImage.
Definition at line 146 of file XrSwapchainImage.cpp.
| uint32_t evan::XrSwapchainImage::_height = 0 |
The height of the swapchain images, which is determined based on the swapchain creation info and surface capabilities. This dimension is essential for configuring the rendering pipeline and ensuring that rendered content is correctly sized for presentation.
Definition at line 223 of file XrSwapchainImage.hpp.
| XrSwapchain evan::XrSwapchainImage::_swapchain = XR_NULL_HANDLE |
The OpenXR swapchain handle associated with the swapchain images.
Definition at line 190 of file XrSwapchainImage.hpp.
| uint32_t evan::XrSwapchainImage::_width = 0 |
The dimensions (width and height) of the swapchain images, which are determined based on the swapchain creation info and surface capabilities. These dimensions are essential for configuring the rendering pipeline and ensuring that rendered content is correctly sized for presentation.
Definition at line 207 of file XrSwapchainImage.hpp.