diff options
Diffstat (limited to 'src/font.hpp')
| -rw-r--r-- | src/font.hpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/font.hpp b/src/font.hpp index 116ac06..fc9c909 100644 --- a/src/font.hpp +++ b/src/font.hpp @@ -5,29 +5,15 @@ #include "components.hpp" #include "pk.h" -#include <glm/vec4.hpp> - -/* -Vert: (two triangles) -vec2 vertex -vec2 uv - -Inst: -vec4 fg_color -vec4 bg_color -vec4 sprite_region -float width - -Texture: -the MTSDF -*/ +#include <glm/vec2.hpp> TypeSafeInt_H(FontTypeIndex, uint16_t, 0xFFFF); TypeSafeInt_H(FontRenderIndex, uint16_t, 0xFFFF); struct FontGlyphChar { uint32_t unicode; - glm::ivec4 bounds; + glm::vec2 sprite_region_min; + glm::vec2 sprite_region_max; }; struct FontRender { uint32_t len; @@ -47,6 +33,7 @@ struct FontType : public Entity_Base { VkDescriptorSet *vkDescriptorSets = nullptr; FontGlyphChar *glyphs; FontRender *renders = nullptr; + glm::vec2 atlas_size; uint32_t n_glyphs; FontRenderIndex n_render = FontRenderIndex{0}; FontRenderIndex h_render = FontRenderIndex{0}; @@ -54,11 +41,11 @@ struct FontType : public Entity_Base { struct FontTypeBindings { BufferBindingDetails vertexBD; BufferBindingDetails uvBD; + BufferBindingDetails atlasSizeBD; BufferBindingDetails indexBD; BufferBindingDetails instanceBD; - uint32_t indexCount; + uint32_t indexCount = 0; uint32_t instanceCounter = 0; - uint32_t instanceBufferMaxCount = 0; } bindings; }; |
