2019-07-13 02:38:42 +08:00
|
|
|
|
#ifndef HGL_GRAPH_VULKAN_SWAP_CHAIN_INCLUDE
|
2019-07-13 02:37:19 +08:00
|
|
|
|
#define HGL_GRAPH_VULKAN_SWAP_CHAIN_INCLUDE
|
|
|
|
|
|
2019-07-16 20:57:17 +08:00
|
|
|
|
#include<hgl/graph/vulkan/VK.h>
|
|
|
|
|
#include<hgl/graph/vulkan/VKTexture.h>
|
|
|
|
|
#include<hgl/type/List.h>
|
2019-07-13 02:37:19 +08:00
|
|
|
|
VK_NAMESPACE_BEGIN
|
2019-07-16 20:57:17 +08:00
|
|
|
|
struct Swapchain
|
2019-07-15 22:37:00 +08:00
|
|
|
|
{
|
2019-07-16 20:57:17 +08:00
|
|
|
|
public:
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2019-07-16 20:57:17 +08:00
|
|
|
|
VkDevice device =VK_NULL_HANDLE;
|
|
|
|
|
|
|
|
|
|
VkExtent2D extent;
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2019-07-16 20:57:17 +08:00
|
|
|
|
VkQueue graphics_queue =VK_NULL_HANDLE;
|
|
|
|
|
VkSwapchainKHR swap_chain =VK_NULL_HANDLE;
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2019-07-16 20:57:17 +08:00
|
|
|
|
uint32_t swap_chain_count=0;
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
2019-07-16 20:57:17 +08:00
|
|
|
|
ObjectList<Texture2D> sc_color;
|
|
|
|
|
Texture2D * sc_depth =nullptr;
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-07-16 20:57:17 +08:00
|
|
|
|
VkSwapchainKHR GetSwapchain () {return swap_chain;}
|
|
|
|
|
const VkExtent2D & GetExtent ()const {return extent;}
|
|
|
|
|
const uint32_t GetImageCount ()const {return sc_color.GetCount();}
|
2019-07-16 19:59:53 +08:00
|
|
|
|
|
2019-07-16 20:57:17 +08:00
|
|
|
|
Texture2D ** GetColorTextures () {return sc_color.GetData();}
|
|
|
|
|
Texture2D * GetColorTexture (int index) {return sc_color[index];}
|
|
|
|
|
Texture2D * GetDepthTexture () {return sc_depth;}
|
2019-07-13 02:37:19 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-07-15 22:37:00 +08:00
|
|
|
|
virtual ~Swapchain();
|
2019-07-16 20:57:17 +08:00
|
|
|
|
};//struct Swapchain
|
2019-07-13 02:37:19 +08:00
|
|
|
|
VK_NAMESPACE_END
|
|
|
|
|
#endif//HGL_GRAPH_VULKAN_SWAP_CHAIN_INCLUDE
|