2018-11-30 20:04:00 +08:00
|
|
|
|
#ifndef HGL_GRAPH_RENDERABLE_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_RENDERABLE_INCLUDE
|
|
|
|
|
|
2019-03-27 14:19:18 +08:00
|
|
|
|
#include<hgl/graph/VertexArray.h>
|
2018-12-05 21:08:18 +08:00
|
|
|
|
|
2018-11-30 20:04:00 +08:00
|
|
|
|
namespace hgl
|
|
|
|
|
{
|
|
|
|
|
namespace graph
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* 可渲染对象
|
|
|
|
|
*/
|
|
|
|
|
class Renderable
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
|
2019-03-27 14:19:18 +08:00
|
|
|
|
uint primitive; ///<绘制的图元类型
|
|
|
|
|
VertexArray *vao;
|
|
|
|
|
|
|
|
|
|
// Material *mtl;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
Renderable(uint prim,VertexArray *va=nullptr)
|
|
|
|
|
{
|
|
|
|
|
primitive=prim;
|
|
|
|
|
vao=va;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const uint GetPrimitive()const { return primitive; } ///<取得要绘制的图元类型
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
uint GetDrawCount(); ///<取得可绘制的数据总数量
|
|
|
|
|
bool Draw(); ///<绘制
|
2018-11-30 20:04:00 +08:00
|
|
|
|
};//class Renderable
|
|
|
|
|
}//namespace graph
|
|
|
|
|
}//namespace hgl
|
|
|
|
|
#endif//HGL_GRAPH_RENDERABLE_INCLUDE
|