ULRE/inc/hgl/graph/RenderNode2D.h

51 lines
1.1 KiB
C
Raw Normal View History

2023-03-23 21:43:10 +08:00
#ifndef HGL_GRAPH_RENDER_NODE_2D_INCLUDE
#define HGL_GRAPH_RENDER_NODE_2D_INCLUDE
2023-03-24 22:14:43 +08:00
#include<hgl/math/Math.h>
2023-04-25 18:08:26 +08:00
#include<hgl/type/Map.h>
2023-03-23 21:43:10 +08:00
namespace hgl
{
namespace graph
{
class Renderable;
2023-04-25 18:08:26 +08:00
class Material;
2023-03-23 21:43:10 +08:00
struct RenderNode2D
{
2023-03-24 22:14:43 +08:00
Matrix3x4f local_to_world;
2023-03-23 21:43:10 +08:00
Renderable *ri;
};
using RenderNode2DList=List<RenderNode2D *>;
2023-04-25 18:08:26 +08:00
/**
*
*/
struct MaterialRenderList2D
{
Material *mtl;
RenderNode2DList rn_list;
};
class MaterialRenderMap2D:public ObjectMap<Material *,MaterialRenderList2D>
{
public:
MaterialRenderMap2D()=default;
virtual ~MaterialRenderMap2D()=default;
void ClearData()
{
for(auto *it:data_list)
it->value->rn_list.ClearData();
}
};
2023-03-23 21:43:10 +08:00
}//namespace graph
}//namespace hgl
using RenderNode2DPointer=hgl::graph::RenderNode2D *;
using RenderNode2DComparator=Comparator<RenderNode2DPointer>;
#endif//HGL_GRAPH_RENDER_NODE_2D_INCLUDE