#pragma once #include #include #include class Renderer { public: Renderer(); void initSwapchain(VkSurfaceKHR surface, int width, int height); void resize(VkSurfaceKHR surface, int width, int height); void render(); VkInstance instance = VK_NULL_HANDLE; VkPhysicalDevice physicalDevice = VK_NULL_HANDLE; VkDevice device = VK_NULL_HANDLE; VkQueue graphicsQueue = VK_NULL_HANDLE, presentQueue = VK_NULL_HANDLE; VkCommandPool commandPool = VK_NULL_HANDLE; VkSwapchainKHR swapchain = VK_NULL_HANDLE; VkExtent2D swapchainExtent; std::vector swapchainImages; std::vector swapchainViews; std::vector swapchainFramebuffers; VkRenderPass renderPass; std::array commandBuffers; std::array inFlightFences; std::array imageAvailableSemaphores, renderFinishedSemaphores; uint32_t currentFrame = 0; };