39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <Orange/Core/Span.h>
|
|
#include <Orange/Core/Result.h>
|
|
#include <Orange/Core/SmallVector.h>
|
|
|
|
#include <Orange/Render/RenderContext.h>
|
|
|
|
namespace orange
|
|
{
|
|
class Swapchain
|
|
{
|
|
public:
|
|
~Swapchain();
|
|
|
|
static Result<Swapchain> Create(RenderContext& context, VkSurfaceKHR surface);
|
|
protected:
|
|
friend class Result<Swapchain>;
|
|
Swapchain(VkDevice device, VkSurfaceKHR surface, VkFormat format, VkExtent2D extent, VkSwapchainKHR swapchain,
|
|
Span<VkImage> images, Span<VkImageView> imageViews)
|
|
: m_device { device }
|
|
, m_surface { surface }
|
|
, m_format { format }
|
|
, m_extent { extent }
|
|
, m_swapchain { swapchain }
|
|
, m_images { images }
|
|
, m_imageViews{ imageViews }
|
|
{}
|
|
private:
|
|
VkDevice m_device;
|
|
VkSurfaceKHR m_surface;
|
|
VkFormat m_format;
|
|
VkExtent2D m_extent;
|
|
VkSwapchainKHR m_swapchain;
|
|
|
|
SmallVector<VkImage, 8> m_images;
|
|
SmallVector<VkImageView, 8> m_imageViews;
|
|
};
|
|
} |