diff options
Diffstat (limited to 'src/font.hpp')
| -rw-r--r-- | src/font.hpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/font.hpp b/src/font.hpp index 73ffd1d..9b43da2 100644 --- a/src/font.hpp +++ b/src/font.hpp @@ -20,6 +20,11 @@ enum FONT_RENDER_SURFACE_AREA_TYPE_FLAGS : uint8_t { FONT_RENDER_SURFACE_AREA_TYPE_FLAGS_FLUID = (1 << 0) | (1 << 1), }; +struct FontRenderHandle { + FontTypeIndex index_ft; + FontRenderIndex index_fr; +}; + struct FontGlyphChar { double advance; glm::vec2 sprite_region_min; @@ -37,11 +42,10 @@ struct FontRenderSettings { FONT_RENDER_SURFACE_AREA_TYPE_FLAGS surface_area_type_flags; // TODO }; struct FontRender { + FontRenderHandle handle; uint32_t *glyph_indices; uint32_t n_glyphs; uint32_t buffer_start_index; - FontTypeIndex index_ft; - FontRenderIndex index_fr; FontRenderSettings settings; }; struct FontTypeMSDFSettings { @@ -88,6 +92,7 @@ struct FontType : public Entity_Base { BufferBindingDetails instanceBD; uint32_t indexCount = 0; uint32_t instanceCounter = 0; + uint32_t instanceLength = 0; } bindings; }; @@ -99,7 +104,7 @@ void FontType_Deserialize(std::ifstream &stream); FontType* FontType_GetFonts(FontTypeIndex &count); FontTypeIndex FontType_RegisterFont(pk_cstr title, AssetHandle fontTextureHandle, AssetHandle glyphsHandle, FontTypeMSDFSettings *msdf_settings, FontTypeSpacing *spacing); void FontType_Unload(FontTypeIndex idx); -FontRender FontType_AddStringRender(FontTypeIndex idx_ft, pk_str str, FontRenderSettings *settings); -void FontType_RemoveStringRender(FontRender fr); +FontRenderHandle FontType_AddStringRender(FontTypeIndex idx_ft, pk_str str, FontRenderSettings *settings); +void FontType_RemoveStringRender(FontRenderHandle fr); #endif /* PKE_FONT_TYPE_HPP */ |
