src/core/VulkanSwapchain.cpp
void VulkanSwapchain::cleanup()
{
    if (swapChain != VK_NULL_HANDLE)
    {
        for (uint32_t i = 0; i < imageCount; i++)
        {
            vkDestroyImageView(device, buffers[i].view, nullptr);
        }
    }
    if (surface != VK_NULL_HANDLE)
    {
        vkDestroySwapchainKHR(device, swapChain, nullptr);
        vkDestroySurfaceKHR(instance, surface, nullptr);
    }
    surface = VK_NULL_HANDLE;
    swapChain = VK_NULL_HANDLE;
}
/**
* Destroy and free Vulkan resources used for the swapchain
*/
Destroy and free Vulkan resources used for the swapchain
Destroy and free Vulkan resources used for the swapchain
void VulkanSwapchain::cleanup()
{
    if (swapChain != VK_NULL_HANDLE)
    {
        for (uint32_t i = 0; i < imageCount; i++)
        {
            vkDestroyImageView(device, buffers[i].view, nullptr);
        }
    }
    if (surface != VK_NULL_HANDLE)
    {
        vkDestroySwapchainKHR(device, swapChain, nullptr);
        vkDestroySurfaceKHR(instance, surface, nullptr);
    }
    surface = VK_NULL_HANDLE;
    swapChain = VK_NULL_HANDLE;
}
void VulkanSwapchain :: cleanup ( ) { if ( swapChain != VK_NULL_HANDLE ) { for ( uint32_t i = 0 ; i < imageCount ; i ++ ) { vkDestroyImageView ( device , buffers [ i ] . view , nullptr ) ; } } if ( surface != VK_NULL_HANDLE ) { vkDestroySwapchainKHR ( device , swapChain , nullptr ) ; vkDestroySurfaceKHR ( instance , surface , nullptr ) ; } surface = VK_NULL_HANDLE ; swapChain = VK_NULL_HANDLE ; }
Destroy and free Vulkan resources used for the swapchain
Destroy and free Vulkan resources used for the swapchain