2023-03-24 22:14:43 +08:00
|
|
|
|
#ifndef HGL_GRAPH_RENDER_LIST_2D_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_RENDER_LIST_2D_INCLUDE
|
2023-03-23 21:43:10 +08:00
|
|
|
|
|
|
|
|
|
#include<hgl/graph/VK.h>
|
|
|
|
|
#include<hgl/graph/SceneNode.h>
|
2023-03-24 22:14:43 +08:00
|
|
|
|
#include<hgl/graph/RenderNode2D.h>
|
2023-03-23 21:43:10 +08:00
|
|
|
|
#include<hgl/graph/VKArrayBuffer.h>
|
2023-03-24 22:14:43 +08:00
|
|
|
|
#include<hgl/graph/VKMaterial.h>
|
2023-03-23 21:43:10 +08:00
|
|
|
|
namespace hgl
|
|
|
|
|
{
|
|
|
|
|
namespace graph
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* 渲染对象列表<br>
|
2023-05-06 19:30:08 +08:00
|
|
|
|
* 该类会长期保存使用过的材质信息,避重新分配造成的时间和空间浪费。如需彻底清空列表请使用Clear()函数
|
2023-03-23 21:43:10 +08:00
|
|
|
|
*/
|
2023-03-24 22:14:43 +08:00
|
|
|
|
class RenderList2D
|
2023-03-23 21:43:10 +08:00
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
|
2023-03-24 22:14:43 +08:00
|
|
|
|
GPUDevice * device;
|
2023-03-23 21:43:10 +08:00
|
|
|
|
|
2023-05-06 19:30:08 +08:00
|
|
|
|
uint renderable_count; ///<可渲染对象数量
|
|
|
|
|
MaterialRenderMap2D mrl_map; ///<按材质分类的渲染列表
|
2023-03-23 21:43:10 +08:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
2023-05-06 19:30:08 +08:00
|
|
|
|
virtual bool ExpendNode(SceneNode *);
|
2023-03-23 21:43:10 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2023-03-24 22:14:43 +08:00
|
|
|
|
RenderList2D(GPUDevice *);
|
|
|
|
|
virtual ~RenderList2D();
|
2023-03-23 21:43:10 +08:00
|
|
|
|
|
2023-05-06 19:30:08 +08:00
|
|
|
|
virtual bool Expend(SceneNode *); ///<展开场景树到渲染列表
|
|
|
|
|
|
|
|
|
|
virtual bool Render(RenderCmdBuffer *); ///<渲染所有对象
|
2023-03-23 21:43:10 +08:00
|
|
|
|
|
2023-05-06 19:30:08 +08:00
|
|
|
|
virtual void Clear(); ///<彻底清理
|
2023-03-24 22:14:43 +08:00
|
|
|
|
};//class RenderList2D
|
2023-03-23 21:43:10 +08:00
|
|
|
|
}//namespace graph
|
|
|
|
|
}//namespace hgl
|
2023-03-24 22:14:43 +08:00
|
|
|
|
#endif//HGL_GRAPH_RENDER_LIST_2D_INCLUDE
|