ULRE/inc/hgl/graph/font/TextRender.h

67 lines
1.9 KiB
C
Raw Normal View History

2022-02-16 23:26:50 +08:00
#ifndef HGL_GRAPH_TEXT_RENDER_INCLUDE
#define HGL_GRAPH_TEXT_RENDER_INCLUDE
#include<hgl/graph/VK.h>
#include<hgl/type/Color4f.h>
namespace hgl
{
namespace graph
{
class FontSource;
class FontSourceMulti;
class TileFont;
class TextLayout;
class TextRenderable;
class TextRender
{
GPUDevice * device =nullptr;
RenderResource * db =nullptr;
Material * material =nullptr;
MaterialInstance * material_instance =nullptr;
Sampler * sampler =nullptr;
Pipeline * pipeline =nullptr;
FontSource * eng_fs =nullptr;
FontSource * chs_fs =nullptr;
FontSourceMulti * font_source =nullptr;
TileFont * tile_font =nullptr;
TextLayout * tl_engine =nullptr;
Color4f color;
GPUBuffer * ubo_color =nullptr;
private:
friend TextRender *CreateTextRender(GPUDevice *,RenderPass *,GPUBuffer *);
TextRender(GPUDevice *dev);
public:
~TextRender();
private:
bool InitTileFont();
bool InitTextLayoutEngine();
bool InitUBO();
bool InitMaterial(RenderPass *,GPUBuffer *);
public:
bool Init(RenderPass *rp,GPUBuffer *ubo_camera_info);
TextRenderable *CreateRenderable();
RenderableInstance *CreateRenderableInstance(TextRenderable *text_render_obj,const UTF16String &str);
};//class TextRender
TextRender *CreateTextRender(GPUDevice *,RenderPass *,GPUBuffer *);
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_TEXT_RENDER_INCLUDE