#pragma once #include #include #include #include #include namespace engine { struct DepthStencil { VkImage image = VK_NULL_HANDLE; VmaAllocation allocation = VK_NULL_HANDLE; VkImageView view = VK_NULL_HANDLE; }; struct Swapchain { VkSwapchainKHR swapchain = VK_NULL_HANDLE; VkDevice device = VK_NULL_HANDLE; // the associated device VmaAllocator allocator = VK_NULL_HANDLE; // the associated allocator VkSurfaceFormatKHR surfaceFormat{}; VkSurfaceCapabilitiesKHR surfaceCapabilities{}; VkPresentModeKHR presentMode{}; VkExtent2D extent{}; //VkRenderPass renderpass = VK_NULL_HANDLE; VkFormat depthStencilFormat; std::vector> swapchainImages{}; std::vector depthImages{}; //std::vector framebuffers{}; }; struct SwapchainInfo { VkDevice device; VkPhysicalDevice physicalDevice; VkSurfaceKHR surface; SDL_Window* window; VmaAllocator allocator; bool vsync; bool waitForPresent; }; void createSwapchain(Swapchain* sc, const SwapchainInfo& info); void destroySwapchain(const Swapchain& sc); }