ULRE/inc/hgl/graph/vulkan/VKRenderTarget.h

46 lines
1.1 KiB
C
Raw Normal View History

2019-06-19 21:12:39 +08:00
#ifndef HGL_GRAPH_VULKAN_RENDER_TARGET_INCLUDE
#define HGL_GRAPH_VULKAN_RENDER_TARGET_INCLUDE
#include<hgl/graph/vulkan/VK.h>
#include<hgl/graph/vulkan/VKRenderPass.h>
#include<hgl/graph/vulkan/VKFramebuffer.h>
VK_NAMESPACE_BEGIN
class RenderTarget
{
Device *device;
RenderPass *rp;
Framebuffer *fb;
VkExtent2D extent;
List<ImageView *> colors;
ImageView *depth;
private:
friend class Device;
RenderTarget(Device *dev,RenderPass *_rp,Framebuffer *_fb)
{
device=dev;
rp=_rp;
fb=_fb;
}
public:
virtual ~RenderTarget()
2019-06-19 21:12:39 +08:00
{
if(fb)
delete fb;
2019-06-19 21:12:39 +08:00
}
const VkExtent2D & GetExtent ()const{return extent;} ///<取得画面尺寸
const uint GetColorCount ()const{colors.GetCount();} ///<取得颜色成份数量
const bool IsExistDepth ()const{return depth;} ///<是否存在深度成份
};//class RenderTarget
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_RENDER_TARGET_INCLUDE