auto clear chars from tile font.

This commit is contained in:
2022-02-21 17:13:12 +08:00
parent eb30999133
commit fe730defb7
9 changed files with 70 additions and 24 deletions

View File

@@ -101,6 +101,7 @@ namespace hgl
int draw_chars_count; ///<要绘制字符列表
SortedSets<u32char> chars_sets; ///<不重复字符统计缓冲区
SortedSets<u32char> clear_chars_sets; ///<待清除的字符合集
TileUVFloatMap chars_uv; ///<所有要绘制字符的uv
struct CharDrawAttr
@@ -111,7 +112,7 @@ namespace hgl
ObjectList<CharDrawAttr> draw_chars_list; ///<所有字符属性列表
template<typename T> bool preprocess(TileFont *,const T *,const int);
template<typename T> bool preprocess(TextRenderable *,TileFont *,const T *,const int);
protected:

View File

@@ -33,6 +33,8 @@ namespace hgl
Color4f color;
GPUBuffer * ubo_color;
SortedSets<TextRenderable *> tr_sets;
private:
friend TextRender *CreateTextRender(GPUDevice *,FontSource *,RenderPass *,GPUBuffer *);
@@ -57,6 +59,8 @@ namespace hgl
bool Layout(TextRenderable *tr,const UTF16String &str);
RenderableInstance *CreateRenderableInstance(TextRenderable *text_render_obj);
void Release(TextRenderable *);
};//class TextRender
/**

View File

@@ -19,10 +19,24 @@ namespace hgl
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);
virtual ~TextRenderable();
public: