Dynamic window resizing

This commit is contained in:
2026-02-20 21:25:33 +00:00
parent e4124c0aaf
commit 11783743de
9 changed files with 143 additions and 60 deletions

View File

@@ -6,6 +6,7 @@
#include <vulkan/vulkan.h>
// std lib headers
#include <memory>
#include <string>
#include <vector>
@@ -16,6 +17,7 @@ class CveSwapChain {
static constexpr int MAX_FRAMES_IN_FLIGHT = 2;
CveSwapChain(CveDevice &deviceRef, VkExtent2D windowExtent);
CveSwapChain(CveDevice &deviceRef, VkExtent2D windowExtent, std::shared_ptr<CveSwapChain> previous);
~CveSwapChain();
CveSwapChain(const CveSwapChain &) = delete;
@@ -39,6 +41,7 @@ class CveSwapChain {
VkResult submitCommandBuffers(const VkCommandBuffer *buffers, uint32_t *imageIndex);
private:
void init();
void createSwapChain();
void createImageViews();
void createDepthResources();
@@ -69,6 +72,7 @@ class CveSwapChain {
VkExtent2D windowExtent;
VkSwapchainKHR swapChain;
std::shared_ptr<CveSwapChain> oldSwapChain;
std::vector<VkSemaphore> imageAvailableSemaphores;
std::vector<VkSemaphore> renderFinishedSemaphores;