diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-02-05 19:09:10 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-02-05 19:09:10 -0500 |
| commit | a9fb380f9d0b53cde554b265d9c6b66d26183c38 (patch) | |
| tree | 8ea3648c497d4a3ac8ce2f6dafa2beca324e7249 /src/font.hpp | |
| parent | 61e179f9580c985cb5ca80ea732fc7572d31c489 (diff) | |
pke: mtsdf displays, bypass fg/bg not working
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; }; |
