renamed to Primitive from Renderable
This commit is contained in:
@@ -18,12 +18,12 @@ namespace hgl
|
||||
RectScope2f scope;
|
||||
};//struct RectangleCreateInfo
|
||||
|
||||
Renderable *CreateRenderableRectangle(RenderResource *db,const VAB *vab,const RectangleCreateInfo *rci);
|
||||
Primitive *CreateRenderableRectangle(RenderResource *db,const VAB *vab,const RectangleCreateInfo *rci);
|
||||
|
||||
/**
|
||||
* 创建延迟渲染用全屏平面
|
||||
*/
|
||||
Renderable *CreateRenderableGBufferComposition(RenderResource *db,const VAB *vab);
|
||||
Primitive *CreateRenderableGBufferComposition(RenderResource *db,const VAB *vab);
|
||||
|
||||
/**
|
||||
* 圆角矩形创建信息(扇形/线圈)
|
||||
@@ -34,7 +34,7 @@ namespace hgl
|
||||
uint32_t round_per; ///<圆角精度
|
||||
};//struct RoundRectangleCreateInfo:public RectangleCreateInfo
|
||||
|
||||
Renderable *CreateRenderableRoundRectangle(RenderResource *db,const VAB *vab,const RoundRectangleCreateInfo *rci);
|
||||
Primitive *CreateRenderableRoundRectangle(RenderResource *db,const VAB *vab,const RoundRectangleCreateInfo *rci);
|
||||
|
||||
/**
|
||||
* 圆形创建信息
|
||||
@@ -54,7 +54,7 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个2D圆形(扇形/线圈)
|
||||
*/
|
||||
Renderable *CreateRenderableCircle(RenderResource *db,const VAB *vab,const CircleCreateInfo *cci);
|
||||
Primitive *CreateRenderableCircle(RenderResource *db,const VAB *vab,const CircleCreateInfo *cci);
|
||||
|
||||
/**
|
||||
* 平面网格创建信息
|
||||
@@ -73,7 +73,7 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个平面网格(线条)
|
||||
*/
|
||||
Renderable *CreateRenderablePlaneGrid(RenderResource *db,const VAB *vab,const PlaneGridCreateInfo *pgci);
|
||||
Primitive *CreateRenderablePlaneGrid(RenderResource *db,const VAB *vab,const PlaneGridCreateInfo *pgci);
|
||||
|
||||
struct PlaneCreateInfo
|
||||
{
|
||||
@@ -91,7 +91,7 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个平面(三角形)
|
||||
*/
|
||||
Renderable *CreateRenderablePlane(RenderResource *db,const VAB *vab,const PlaneCreateInfo *pci);
|
||||
Primitive *CreateRenderablePlane(RenderResource *db,const VAB *vab,const PlaneCreateInfo *pci);
|
||||
|
||||
struct CubeCreateInfo
|
||||
{
|
||||
@@ -127,7 +127,7 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个立方体(三角形)
|
||||
*/
|
||||
Renderable *CreateRenderableCube(RenderResource *db,const VAB *vab,const CubeCreateInfo *cci);
|
||||
Primitive *CreateRenderableCube(RenderResource *db,const VAB *vab,const CubeCreateInfo *cci);
|
||||
|
||||
struct BoundingBoxCreateInfo
|
||||
{
|
||||
@@ -158,17 +158,17 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个绑定盒(线条)
|
||||
*/
|
||||
Renderable *CreateRenderableBoundingBox(RenderResource *db,const VAB *vab,const BoundingBoxCreateInfo *cci);
|
||||
Primitive *CreateRenderableBoundingBox(RenderResource *db,const VAB *vab,const BoundingBoxCreateInfo *cci);
|
||||
|
||||
/**
|
||||
* 创建一个球心坐标为0,0,0,半径为1的球体(三角形)
|
||||
*/
|
||||
Renderable *CreateRenderableSphere(RenderResource *db,const VAB *vab,const uint numberSlices);
|
||||
Primitive *CreateRenderableSphere(RenderResource *db,const VAB *vab,const uint numberSlices);
|
||||
|
||||
/**
|
||||
* 创建一个穹顶(三角形)
|
||||
*/
|
||||
Renderable *CreateRenderableDome(RenderResource *db,const VAB *vab, const uint numberSlices);
|
||||
Primitive *CreateRenderableDome(RenderResource *db,const VAB *vab, const uint numberSlices);
|
||||
|
||||
struct TorusCreateInfo
|
||||
{
|
||||
@@ -184,7 +184,7 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个圆环(三角形)
|
||||
*/
|
||||
Renderable *CreateRenderableTorus(RenderResource *db,const VAB *vab,const TorusCreateInfo *tci);
|
||||
Primitive *CreateRenderableTorus(RenderResource *db,const VAB *vab,const TorusCreateInfo *tci);
|
||||
|
||||
struct CylinderCreateInfo
|
||||
{
|
||||
@@ -196,7 +196,7 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个圆柱(三角形)
|
||||
*/
|
||||
Renderable *CreateRenderableCylinder(RenderResource *db,const VAB *vab,const CylinderCreateInfo *cci);
|
||||
Primitive *CreateRenderableCylinder(RenderResource *db,const VAB *vab,const CylinderCreateInfo *cci);
|
||||
|
||||
struct ConeCreateInfo
|
||||
{
|
||||
@@ -209,7 +209,7 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个圆锥(三角形)
|
||||
*/
|
||||
Renderable *CreateRenderableCone(RenderResource *db,const VAB *vab,const ConeCreateInfo *cci);
|
||||
Primitive *CreateRenderableCone(RenderResource *db,const VAB *vab,const ConeCreateInfo *cci);
|
||||
|
||||
struct AxisCreateInfo
|
||||
{
|
||||
@@ -230,7 +230,7 @@ namespace hgl
|
||||
/**
|
||||
* 创建一个坐标线(线条)
|
||||
*/
|
||||
Renderable *CreateRenderableAxis(RenderResource *db,const VAB *vab,const AxisCreateInfo *aci);
|
||||
Primitive *CreateRenderableAxis(RenderResource *db,const VAB *vab,const AxisCreateInfo *aci);
|
||||
}//namespace graph
|
||||
};//namespace hgl
|
||||
#endif//HGL_GRAPH_INLINE_GEOMETRY_INCLUDE
|
||||
|
@@ -78,7 +78,7 @@ namespace hgl
|
||||
uint16 * CreateIBO16(uint count,const uint16 *data=nullptr); ///<创建16位的索引缓冲区
|
||||
uint32 * CreateIBO32(uint count,const uint32 *data=nullptr); ///<创建32位的索引缓冲区
|
||||
|
||||
virtual Renderable * Finish(); ///<结束并创建可渲染对象
|
||||
virtual Primitive * Finish(); ///<结束并创建可渲染对象
|
||||
};//class RenderableCreater
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include<iostream>
|
||||
#include<hgl/graph/VKNamespace.h>
|
||||
#include<hgl/graph/VKFormat.h>
|
||||
#include<hgl/graph/VKPrimivate.h>
|
||||
#include<hgl/graph/VKPrimitiveType.h>
|
||||
#include<hgl/graph/VKStruct.h>
|
||||
#include<hgl/graph/VKRenderbufferInfo.h>
|
||||
|
||||
@@ -78,9 +78,9 @@ enum class DescriptorSetsType
|
||||
Material, ///<材质中永远不变的参数
|
||||
// Texture, ///<材质中的纹理参数
|
||||
Value, ///<材质中的变量参数
|
||||
Renderable, ///<渲染实例参数(如Local2World matrix)
|
||||
Primitive, ///<渲染实例参数(如Local2World matrix)
|
||||
|
||||
ENUM_CLASS_RANGE(Global,Renderable)
|
||||
ENUM_CLASS_RANGE(Global,Primitive)
|
||||
};//
|
||||
|
||||
const DescriptorSetsType CheckDescriptorSetsType(const char *str);
|
||||
@@ -130,7 +130,7 @@ using VABConfigInfo=Map<AnsiString,VAConfig>;
|
||||
class VertexAttributeBinding;
|
||||
using VAB=VertexAttributeBinding;
|
||||
|
||||
class Renderable;
|
||||
class Primitive;
|
||||
class RenderableInstance;
|
||||
|
||||
class RenderResource;
|
||||
|
@@ -67,7 +67,7 @@ public:
|
||||
MaterialParameters * GetMP (const DescriptorSetsType &type)
|
||||
{
|
||||
if(type==DescriptorSetsType::Material )return data->mp.m;else
|
||||
if(type==DescriptorSetsType::Renderable )return data->mp.r;else
|
||||
if(type==DescriptorSetsType::Primitive )return data->mp.r;else
|
||||
if(type==DescriptorSetsType::Global )return data->mp.g;else
|
||||
return(nullptr);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public:
|
||||
MP_TYPE_IS(Material)
|
||||
// MP_TYPE_IS(Texture)
|
||||
MP_TYPE_IS(Value)
|
||||
MP_TYPE_IS(Renderable)
|
||||
MP_TYPE_IS(Primitive)
|
||||
MP_TYPE_IS(Global)
|
||||
#undef MP_TYPE_IS
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include<hgl/graph/VKMaterial.h>
|
||||
#include<hgl/graph/VKPipeline.h>
|
||||
#include<hgl/graph/VKDescriptorSets.h>
|
||||
#include<hgl/graph/VKRenderable.h>
|
||||
#include<hgl/graph/VKPrimitive.h>
|
||||
#include<hgl/graph/VKBuffer.h>
|
||||
#include<hgl/graph/VKSampler.h>
|
||||
#include<hgl/graph/VKTexture.h>
|
||||
@@ -12,14 +12,14 @@
|
||||
#include<hgl/graph/VKMaterialInstance.h>
|
||||
#include<hgl/graph/VertexAttribData.h>
|
||||
#include<hgl/graph/VKRenderableInstance.h>
|
||||
#include<hgl/graph/font/TextRenderable.h>
|
||||
#include<hgl/graph/font/TextPrimitive.h>
|
||||
#include<hgl/type/ResManage.h>
|
||||
VK_NAMESPACE_BEGIN
|
||||
using MaterialID =int;
|
||||
using MaterialInstanceID =int;
|
||||
using BufferID =int;
|
||||
using DescriptorSetsID =int;
|
||||
using RenderableID =int;
|
||||
using PrimitiveID =int;
|
||||
using RenderableInstanceID =int;
|
||||
using SamplerID =int;
|
||||
using TextureID =int;
|
||||
@@ -40,7 +40,7 @@ class RenderResource
|
||||
IDResManage<MaterialID, Material> rm_material; ///<材质合集
|
||||
IDResManage<MaterialInstanceID, MaterialInstance> rm_material_instance; ///<材质实例合集
|
||||
IDResManage<DescriptorSetsID, DescriptorSets> rm_desc_sets; ///<描述符合集
|
||||
IDResManage<RenderableID, Renderable> rm_renderables; ///<可渲染对象合集
|
||||
IDResManage<PrimitiveID, Primitive> rm_primitives; ///<图元合集
|
||||
IDResManage<BufferID, GPUBuffer> rm_buffers; ///<顶点缓冲区合集
|
||||
IDResManage<SamplerID, Sampler> rm_samplers; ///<采样器合集
|
||||
IDResManage<TextureID, Texture> rm_textures; ///<纹理合集
|
||||
@@ -56,7 +56,7 @@ public: //Add
|
||||
MaterialID Add(Material * mtl ){return rm_material.Add(mtl);}
|
||||
MaterialInstanceID Add(MaterialInstance * mi ){return rm_material_instance.Add(mi);}
|
||||
DescriptorSetsID Add(DescriptorSets * ds ){return rm_desc_sets.Add(ds);}
|
||||
RenderableID Add(Renderable * r ){return rm_renderables.Add(r);}
|
||||
PrimitiveID Add(Primitive * p ){return rm_primitives.Add(p);}
|
||||
BufferID Add(GPUBuffer * buf ){return rm_buffers.Add(buf);}
|
||||
SamplerID Add(Sampler * s ){return rm_samplers.Add(s);}
|
||||
TextureID Add(Texture * t ){return rm_textures.Add(t);}
|
||||
@@ -93,9 +93,9 @@ public: //Material
|
||||
MaterialInstance * CreateMaterialInstance(Material *,const VABConfigInfo *vab_cfg=nullptr);
|
||||
MaterialInstance * CreateMaterialInstance(const OSString &,const VABConfigInfo *vab_cfg=nullptr);
|
||||
|
||||
Renderable * CreateRenderable(const uint32_t vertex_count=0);
|
||||
Primitive * CreatePrimitive(const uint32_t vertex_count=0);
|
||||
|
||||
RenderableInstance *CreateRenderableInstance(Renderable *r,MaterialInstance *mi,Pipeline *p);
|
||||
RenderableInstance *CreateRenderableInstance(Primitive *r,MaterialInstance *mi,Pipeline *p);
|
||||
|
||||
Sampler * CreateSampler(VkSamplerCreateInfo *sci=nullptr);
|
||||
Sampler * CreateSampler(Texture *);
|
||||
@@ -110,7 +110,7 @@ public: //Get
|
||||
Material * GetMaterial (const MaterialID &id){return rm_material.Get(id);}
|
||||
MaterialInstance * GetMaterialInstance (const MaterialInstanceID &id){return rm_material_instance.Get(id);}
|
||||
DescriptorSets * GetDescSets (const DescriptorSetsID &id){return rm_desc_sets.Get(id);}
|
||||
Renderable * GetRenderable (const RenderableID &id){return rm_renderables.Get(id);}
|
||||
Primitive * GetRenderable (const PrimitiveID &id){return rm_primitives.Get(id);}
|
||||
GPUBuffer * GetBuffer (const BufferID &id){return rm_buffers.Get(id);}
|
||||
Sampler * GetSampler (const SamplerID &id){return rm_samplers.Get(id);}
|
||||
Texture * GetTexture (const TextureID &id){return rm_textures.Get(id);}
|
||||
|
@@ -1,89 +0,0 @@
|
||||
#ifndef HGL_GRAPH_VULKAN_RENDERABLE_INCLUDE
|
||||
#define HGL_GRAPH_VULKAN_RENDERABLE_INCLUDE
|
||||
|
||||
#include<hgl/graph/VKIndexBuffer.h>
|
||||
#include<hgl/type/Map.h>
|
||||
#include<hgl/type/String.h>
|
||||
#include<hgl/math/Math.h>
|
||||
#include<hgl/graph/AABB.h>
|
||||
VK_NAMESPACE_BEGIN
|
||||
/**
|
||||
* 可渲染数据对象<br>
|
||||
* 本对象包含材质实例信息和Mesh信息,可渲染数据对象中包含供最终API使用的VBO数据,可能存在多个MESH数据的集合。</p>
|
||||
* 比如有多种形状的石头,它们使用了同一种材质,这种情况下多个mesh就可以合并到一个Renderable中,渲染时不再切换VBO。
|
||||
*/
|
||||
class Renderable
|
||||
{
|
||||
struct VBOData
|
||||
{
|
||||
VBO *buf;
|
||||
VkDeviceSize offset;
|
||||
|
||||
public:
|
||||
|
||||
CompOperatorMemcmp(const VBOData &);
|
||||
};
|
||||
|
||||
Map<AnsiString,VBOData> buffer_list;
|
||||
|
||||
protected:
|
||||
|
||||
uint32_t draw_count;
|
||||
|
||||
IndexBuffer *indices_buffer=nullptr;
|
||||
VkDeviceSize indices_offset=0;
|
||||
|
||||
protected:
|
||||
|
||||
AABB BoundingBox;
|
||||
|
||||
protected:
|
||||
|
||||
friend class RenderableNode;
|
||||
|
||||
uint ref_count=0;
|
||||
|
||||
uint RefInc(){return ++ref_count;}
|
||||
uint RefDec(){return --ref_count;}
|
||||
|
||||
public:
|
||||
|
||||
Renderable(const uint32_t dc=0):draw_count(dc){}
|
||||
virtual ~Renderable()=default;
|
||||
|
||||
const uint GetRefCount()const{return ref_count;}
|
||||
|
||||
void SetBoundingBox(const AABB &aabb){BoundingBox=aabb;}
|
||||
const AABB & GetBoundingBox()const {return BoundingBox;}
|
||||
|
||||
bool Set(const AnsiString &name,VBO *vb,VkDeviceSize offset=0);
|
||||
|
||||
bool Set(IndexBuffer *ib,VkDeviceSize offset=0)
|
||||
{
|
||||
if(!ib)return(false);
|
||||
|
||||
indices_buffer=ib;
|
||||
indices_offset=offset;
|
||||
return(true);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void SetDrawCount(const uint32_t dc){draw_count=dc;} ///<设置当前对象绘制需要多少个顶点
|
||||
virtual const uint32_t GetDrawCount()const ///<取得当前对象绘制需要多少个顶点
|
||||
{
|
||||
if(indices_buffer)
|
||||
return indices_buffer->GetCount();
|
||||
|
||||
return draw_count;
|
||||
}
|
||||
|
||||
VBO * GetVBO (const AnsiString &,VkDeviceSize *);
|
||||
VkBuffer GetBuffer (const AnsiString &,VkDeviceSize *);
|
||||
const int GetBufferCount ()const {return buffer_list.GetCount();}
|
||||
|
||||
IndexBuffer * GetIndexBuffer () {return indices_buffer;}
|
||||
const VkDeviceSize GetIndexBufferOffset()const {return indices_offset;}
|
||||
};//class Renderable
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_VULKAN_RENDERABLE_INCLUDE
|
@@ -1,7 +1,7 @@
|
||||
#ifndef HGL_GRAPH_RENDERABLE_INSTANCE_INCLUDE
|
||||
#define HGL_GRAPH_RENDERABLE_INSTANCE_INCLUDE
|
||||
|
||||
#include<hgl/graph/VKRenderable.h>
|
||||
#include<hgl/graph/VKPrimitive.h>
|
||||
#include<hgl/graph/VKPipeline.h>
|
||||
#include<hgl/graph/VKDescriptorSets.h>
|
||||
#include<hgl/graph/VKMaterial.h>
|
||||
@@ -16,7 +16,7 @@ class RenderableInstance
|
||||
{
|
||||
Pipeline * pipeline;
|
||||
MaterialInstance * mat_inst;
|
||||
Renderable * render_obj;
|
||||
Primitive * render_obj;
|
||||
|
||||
uint32_t buffer_count;
|
||||
VkBuffer * buffer_list;
|
||||
@@ -26,9 +26,9 @@ class RenderableInstance
|
||||
|
||||
private:
|
||||
|
||||
friend RenderableInstance *CreateRenderableInstance(Renderable *,MaterialInstance *,Pipeline *);
|
||||
friend RenderableInstance *CreateRenderableInstance(Primitive *,MaterialInstance *,Pipeline *);
|
||||
|
||||
RenderableInstance(Renderable *,MaterialInstance *,Pipeline *,const uint32_t,VkBuffer *,VkDeviceSize *);
|
||||
RenderableInstance(Primitive *,MaterialInstance *,Pipeline *,const uint32_t,VkBuffer *,VkDeviceSize *);
|
||||
|
||||
public:
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
VkPipelineLayout GetPipelineLayout (){return mat_inst->GetMaterial()->GetPipelineLayout();}
|
||||
Material * GetMaterial (){return mat_inst->GetMaterial();}
|
||||
MaterialInstance * GetMaterialInstance (){return mat_inst;}
|
||||
Renderable * GetRenderable (){return render_obj;}
|
||||
Primitive * GetRenderable (){return render_obj;}
|
||||
const AABB & GetBoundingBox ()const{return render_obj->GetBoundingBox();}
|
||||
|
||||
const uint32_t GetBufferCount ()const{return buffer_count;}
|
||||
@@ -59,6 +59,6 @@ public: //instance support
|
||||
virtual const uint32_t GetInstanceCount ()const{return 1;}
|
||||
};//class RenderableInstance
|
||||
|
||||
RenderableInstance *CreateRenderableInstance(Renderable *,MaterialInstance *,Pipeline *);
|
||||
RenderableInstance *CreateRenderableInstance(Primitive *,MaterialInstance *,Pipeline *);
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_RENDERABLE_INSTANCE_INCLUDE
|
||||
|
@@ -11,7 +11,7 @@ namespace hgl
|
||||
namespace graph
|
||||
{
|
||||
class TileFont;
|
||||
class TextRenderable;
|
||||
class TextPrimitive;
|
||||
|
||||
/**
|
||||
* 字符属性,可精确到字也可精确到段落或是全文
|
||||
@@ -112,7 +112,7 @@ namespace hgl
|
||||
|
||||
ObjectList<CharDrawAttr> draw_chars_list; ///<所有字符属性列表
|
||||
|
||||
template<typename T> bool preprocess(TextRenderable *,TileFont *,const T *,const int);
|
||||
template<typename T> bool preprocess(TextPrimitive *,TileFont *,const T *,const int);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace hgl
|
||||
int sl_v_r2l();
|
||||
int sl_v_l2r();
|
||||
|
||||
template<typename T> int SimpleLayout(TextRenderable *,TileFont *,const String<T> &); ///<简易排版
|
||||
template<typename T> int SimpleLayout(TextPrimitive *,TileFont *,const String<T> &); ///<简易排版
|
||||
|
||||
// template<typename T> int SimpleLayout(TileFont *,const StringList<String<T>> &); ///<简易排版
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace hgl
|
||||
|
||||
protected:
|
||||
|
||||
TextRenderable *text_render_obj;
|
||||
TextPrimitive *text_render_obj;
|
||||
MemBlock<int16> vertex;
|
||||
MemBlock<float> tex_coord;
|
||||
|
||||
@@ -167,8 +167,8 @@ namespace hgl
|
||||
|
||||
virtual bool Init (); ///<初始化排版
|
||||
|
||||
int SimpleLayout (TextRenderable *,TileFont *,const UTF16String &); ///<简易排版
|
||||
int SimpleLayout (TextRenderable *,TileFont *,const UTF32String &); ///<简易排版
|
||||
int SimpleLayout (TextPrimitive *,TileFont *,const UTF16String &); ///<简易排版
|
||||
int SimpleLayout (TextPrimitive *,TileFont *,const UTF32String &); ///<简易排版
|
||||
|
||||
// int SimpleLayout (TileFont *,const UTF16StringList &); ///<简易排版
|
||||
// int SimpleLayout (TileFont *,const UTF32StringList &); ///<简易排版
|
||||
|
@@ -11,7 +11,7 @@ namespace hgl
|
||||
class FontSource;
|
||||
class TileFont;
|
||||
class TextLayout;
|
||||
class TextRenderable;
|
||||
class TextPrimitive;
|
||||
|
||||
class TextRender
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace hgl
|
||||
Color4f color;
|
||||
GPUBuffer * ubo_color;
|
||||
|
||||
SortedSets<TextRenderable *> tr_sets;
|
||||
SortedSets<TextPrimitive *> tr_sets;
|
||||
|
||||
private:
|
||||
|
||||
@@ -53,14 +53,14 @@ namespace hgl
|
||||
|
||||
public:
|
||||
|
||||
TextRenderable *CreateRenderable();
|
||||
TextRenderable *CreateRenderable(const UTF16String &str);
|
||||
TextPrimitive *CreatePrimitive();
|
||||
TextPrimitive *CreatePrimitive(const UTF16String &str);
|
||||
|
||||
bool Layout(TextRenderable *tr,const UTF16String &str);
|
||||
bool Layout(TextPrimitive *tr,const UTF16String &str);
|
||||
|
||||
RenderableInstance *CreateRenderableInstance(TextRenderable *text_render_obj);
|
||||
RenderableInstance *CreateRenderableInstance(TextPrimitive *text_render_obj);
|
||||
|
||||
void Release(TextRenderable *);
|
||||
void Release(TextPrimitive *);
|
||||
};//class TextRender
|
||||
|
||||
/**
|
||||
|
@@ -1,50 +0,0 @@
|
||||
#ifndef HGL_GRAPH_TEXT_RENDERABLE_INCLUDE
|
||||
#define HGL_GRAPH_TEXT_RENDERABLE_INCLUDE
|
||||
|
||||
#include<hgl/graph/VKRenderable.h>
|
||||
namespace hgl
|
||||
{
|
||||
namespace graph
|
||||
{
|
||||
/**
|
||||
* 文本可渲染对象
|
||||
*/
|
||||
class TextRenderable:public Renderable
|
||||
{
|
||||
GPUDevice * device;
|
||||
Material * mtl;
|
||||
|
||||
uint max_count; ///<缓冲区最大容量
|
||||
|
||||
VBO * vbo_position;
|
||||
VBO * vbo_tex_coord;
|
||||
|
||||
protected:
|
||||
|
||||
friend class TextLayout;
|
||||
friend class TextRender;
|
||||
|
||||
SortedSets<u32char> chars_sets;
|
||||
|
||||
const SortedSets<u32char> &GetCharsSets()const{return chars_sets;}
|
||||
void SetCharsSets(const SortedSets<u32char> &sl){chars_sets=sl;}
|
||||
void ClearCharsSets(){chars_sets.Clear();}
|
||||
|
||||
private:
|
||||
|
||||
virtual ~TextRenderable();
|
||||
|
||||
public:
|
||||
|
||||
TextRenderable(GPUDevice *,Material *,uint mc=1024);
|
||||
|
||||
public:
|
||||
|
||||
void SetCharCount (const uint);
|
||||
|
||||
bool WriteVertex (const int16 *fp);
|
||||
bool WriteTexCoord (const float *fp);
|
||||
};//class TextRenderable:public Renderable
|
||||
}//namespace graph
|
||||
}//namespace hgl
|
||||
#endif//HGL_GRAPH_TEXT_RENDERABLE_INCLUDE
|
Reference in New Issue
Block a user