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

51 lines
1.6 KiB
C
Raw Normal View History

#ifndef HGL_GRAPH_VULKAN_RENDERABLE_INCLUDE
#define HGL_GRAPH_VULKAN_RENDERABLE_INCLUDE
#include<hgl/graph/vulkan/VK.h>
#include<hgl/type/BaseString.h>
VK_NAMESPACE_BEGIN
/**
2019-05-05 01:28:01 +08:00
* <br>
* Mesh信息API使用的VBO数据MESH数据的集合</p>
* 使mesh就可以合并到一个Renderable中VBO
*/
class Renderable
{
const VertexShaderModule *vertex_sm;
int buf_count;
VkBuffer *buf_list=nullptr;
VkDeviceSize *buf_offset=nullptr;
2019-04-25 14:10:18 +08:00
IndexBuffer *indices_buffer=nullptr;
VkDeviceSize indices_offset=0;
public:
Renderable(const VertexShaderModule *);
virtual ~Renderable();
2019-05-06 21:03:05 +08:00
bool Set(const int stage_input_binding, VertexBuffer *vb,VkDeviceSize offset=0);
bool Set(const UTF8String &name, VertexBuffer *vb,VkDeviceSize offset=0);
bool Set(IndexBuffer *ib,VkDeviceSize offset=0)
2019-04-25 14:10:18 +08:00
{
if(!ib)return(false);
indices_buffer=ib;
indices_offset=offset;
return(true);
2019-04-25 14:10:18 +08:00
}
public:
const int GetBufferCount ()const{return buf_count;}
const VkBuffer * GetBuffer ()const{return buf_list;}
const VkDeviceSize * GetOffset ()const{return buf_offset;}
IndexBuffer * GetIndexBuffer() {return indices_buffer;}
2019-04-25 14:10:18 +08:00
const VkDeviceSize GetIndexOffset()const{return indices_offset;}
};//class Renderable
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_RENDERABLE_INCLUDE