diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 2632218b..0d62b8aa 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -1025,15 +1025,15 @@ void VulkanExampleBase::setupRenderPass() void VulkanExampleBase::initSwapchain() { #ifdef _WIN32 - swapChain.initSwapChain(windowInstance, window); + swapChain.initSurface(windowInstance, window); #else - swapChain.initSwapChain(connection, window); + swapChain.initSurface(connection, window); #endif } void VulkanExampleBase::setupSwapChain() { - swapChain.setup(setupCmdBuffer, &width, &height); + swapChain.create(setupCmdBuffer, &width, &height); } diff --git a/base/vulkanswapchain.hpp b/base/vulkanswapchain.hpp index 500b9aa1..d41d3664 100644 --- a/base/vulkanswapchain.hpp +++ b/base/vulkanswapchain.hpp @@ -88,7 +88,7 @@ public: // Creates an os specific surface // Tries to find a graphics and a present queue - void initSwapChain( + void initSurface( #ifdef _WIN32 void* platformHandle, void* platformWindow #else @@ -234,8 +234,8 @@ public: GET_DEVICE_PROC_ADDR(device, QueuePresentKHR); } - // Create the swap chain images with given width and height - void setup(VkCommandBuffer cmdBuffer, uint32_t *width, uint32_t *height) + // Create the swap chain and get images with given width and height + void create(VkCommandBuffer cmdBuffer, uint32_t *width, uint32_t *height) { VkResult err; VkSwapchainKHR oldSwapchain = swapChain; @@ -397,6 +397,7 @@ public: return fpQueuePresentKHR(queue, &presentInfo); } + // Free all Vulkan resources used by the swap chain void cleanup() { for (uint32_t i = 0; i < imageCount; i++)