![]() |
Raven Engine v0.1
|
Holds semaphores used for synchronizing image acquisition and rendering. More...
#include <VulkanSwapchain.h>
Public Member Functions | |
| VulkanSwapchain (u32 *width, u32 *height, bool vsync) | |
| Constructs a VulkanSwapchain. | |
| void | Shutdown () override |
| Destroys the Vulkan swapchain and associated resources. | |
| void | Present () override |
| Presents the currently rendered image to the display. | |
| void | SetVSync (bool vsync) override |
| Enables or disables vertical sync. | |
| void | Resize (u32 width, u32 height) |
| Triggers a resize of the swapchain. | |
| float | GetAspectRatio () const override |
| Returns the current aspect ratio of the swapchain. | |
| void | BeginFrame () |
| Begins a new frame for rendering. | |
| operator VkSwapchainKHR () const | |
| Implicit conversion to VkSwapchainKHR. | |
| std::pair< u32, u32 > | GetExtent () |
| Returns the current width and height of the swapchain. | |
| u32 | AcquireNextImage () |
| Acquires the next available image from the swapchain. | |
| u32 | GetImageIndex () const |
| Gets the index of the current swapchain image. | |
| u8 | GetCurrentFrame () const |
| Gets the current frame index for frame-in-flight tracking. | |
| void * | GetFence () const override |
| Returns the fence used for synchronizing the current frame. | |
| const Semaphores & | GetSemaphores () const |
| Gets the semaphores used for synchronization. | |
| VkImage | GetImage (u32 index) |
| Gets a Vulkan image by index. | |
| std::vector< VkImageView > | GetImageViews () const |
| Returns all swapchain image views. | |
| u32 | GetImageCount () |
| Returns the total number of swapchain images. | |
| Public Member Functions inherited from Raven::Swapchain | |
| virtual | ~Swapchain ()=default |
Static Public Member Functions | |
| static VulkanSwapchain & | Get () |
| Returns a reference to the active VulkanSwapchain instance. | |
| Static Public Member Functions inherited from Raven::Swapchain | |
| static Scope< Swapchain > | Create (u32 *width, u32 *height, bool vsync) |
| Factory method to create a platform-specific swapchain instance. | |
Holds semaphores used for synchronizing image acquisition and rendering.
Vulkan implementation of the platform-agnostic Swapchain.
Each frame-in-flight uses a pair of semaphores:
Handles Vulkan-specific swapchain creation, synchronization, resizing, and presentation.
Constructs a VulkanSwapchain.
| width | Pointer to the current window width. |
| height | Pointer to the current window height. |
| vsync | Whether vertical synchronization is enabled. |
| u32 Raven::VulkanSwapchain::AcquireNextImage | ( | ) |
Acquires the next available image from the swapchain.
| void Raven::VulkanSwapchain::BeginFrame | ( | ) |
Begins a new frame for rendering.
Acquires a new image from the swapchain and prepares for rendering.
|
inlinestatic |
Returns a reference to the active VulkanSwapchain instance.
|
inlineoverridevirtual |
Returns the current aspect ratio of the swapchain.
Implements Raven::Swapchain.
|
inline |
Gets the current frame index for frame-in-flight tracking.
Returns the current width and height of the swapchain.
|
inlineoverridevirtual |
Returns the fence used for synchronizing the current frame.
Implements Raven::Swapchain.
|
inline |
Gets a Vulkan image by index.
| index | Index of the image. |
|
inline |
Returns the total number of swapchain images.
|
inline |
Gets the index of the current swapchain image.
|
inline |
Returns all swapchain image views.
|
inline |
Gets the semaphores used for synchronization.
|
inline |
Implicit conversion to VkSwapchainKHR.
|
overridevirtual |
Presents the currently rendered image to the display.
Implements Raven::Swapchain.
Triggers a resize of the swapchain.
| width | New width. |
| height | New height. |
Implements Raven::Swapchain.
|
overridevirtual |
Enables or disables vertical sync.
| vsync | True to enable, false to disable. |
Implements Raven::Swapchain.
|
overridevirtual |
Destroys the Vulkan swapchain and associated resources.
Implements Raven::Swapchain.