2022-07-19 18:41:44 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <set>
|
|
|
|
#include <algorithm>
|
2022-11-26 16:44:16 +00:00
|
|
|
#include "vlkx/vulkan/abstraction/Image.h"
|
2022-07-19 18:41:44 +00:00
|
|
|
|
|
|
|
class SwapChain {
|
|
|
|
public:
|
|
|
|
SwapChain();
|
|
|
|
~SwapChain();
|
|
|
|
|
|
|
|
VkSwapchainKHR swapChain;
|
|
|
|
VkFormat format;
|
|
|
|
VkExtent2D extent;
|
|
|
|
|
2022-11-26 16:44:16 +00:00
|
|
|
std::vector<std::unique_ptr<vlkx::Image>> images;
|
|
|
|
std::unique_ptr<vlkx::Image> multisampleImg;
|
2022-07-19 18:41:44 +00:00
|
|
|
|
|
|
|
VkSurfaceFormatKHR chooseFormat(const std::vector<VkSurfaceFormatKHR>& availableFormats);
|
|
|
|
VkPresentModeKHR chooseMode(const std::vector<VkPresentModeKHR>& availableModes);
|
|
|
|
VkExtent2D chooseExtent(const VkSurfaceCapabilitiesKHR& capabilities);
|
|
|
|
|
|
|
|
void create(VkSurfaceKHR surface);
|
|
|
|
void destroy();
|
|
|
|
};
|