ULRE/inc/hgl/graph/RenderList.h

51 lines
1.3 KiB
C
Raw Normal View History

2019-05-25 00:50:04 +08:00
#ifndef HGL_GRAPH_RENDER_LIST_INCLUDE
#define HGL_GRAPH_RENDER_LIST_INCLUDE
#include<hgl/graph/vulkan/VK.h>
#include<hgl/graph/Camera.h>
#include<hgl/graph/SceneNode.h>
2019-05-25 01:06:33 +08:00
#include<hgl/type/Color4f.h>
2019-05-25 00:50:04 +08:00
namespace hgl
{
namespace graph
{
class RenderableInstance;
2019-05-25 00:50:04 +08:00
class RenderList
{
vulkan::CommandBuffer *cmd_buf;
private:
List<SceneNode *> scene_node_list;
2019-05-25 00:50:04 +08:00
vulkan::PushConstant * last_pc;
vulkan::Pipeline * last_pipeline;
vulkan::MaterialInstance * last_mat_inst;
vulkan::Renderable * last_renderable;
2019-05-25 00:50:04 +08:00
void Render(SceneNode *,RenderableInstance *);
void Render(SceneNode *,List<RenderableInstance *> &);
2019-05-25 00:50:04 +08:00
public:
RenderList()
{
cmd_buf=nullptr;
last_pc=nullptr;
2019-05-25 00:50:04 +08:00
last_pipeline=nullptr;
last_mat_inst=nullptr;
2019-05-25 00:50:04 +08:00
last_renderable=nullptr;
}
~RenderList()=default;
void Add (SceneNode *node) {if(node)scene_node_list.Add(node);}
void Clear () {scene_node_list.ClearData();}
2019-05-25 00:50:04 +08:00
bool Render(vulkan::CommandBuffer *);
2019-05-25 00:50:04 +08:00
};//class RenderList
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_RENDER_LIST_INCLUDE