Renamed FontDescriptor to Font

main
noah metz 2024-10-18 10:16:04 -06:00
parent 22d3b62b12
commit d04f7769ee
3 changed files with 6 additions and 28 deletions

@ -76,7 +76,7 @@ typedef struct SymbolInfoStruct {
uint32_t advance; uint32_t advance;
} SymbolInfo; } SymbolInfo;
typedef struct FontDescriptorStruct { typedef struct FontStruct {
VmaAllocation symbol_memory; VmaAllocation symbol_memory;
VmaAllocation uniform_memory; VmaAllocation uniform_memory;
VmaAllocation image_memory; VmaAllocation image_memory;
@ -86,7 +86,7 @@ typedef struct FontDescriptorStruct {
VkImageView view; VkImageView view;
VkSampler sampler; VkSampler sampler;
VkDescriptorSet set; VkDescriptorSet set;
} FontDescriptor; } Font;
typedef struct TextPointersMemoryStruct { typedef struct TextPointersMemoryStruct {
VmaAllocation pointers_memory; VmaAllocation pointers_memory;
@ -111,7 +111,7 @@ typedef struct UILayerStruct {
VkDeviceAddress string_pointers; VkDeviceAddress string_pointers;
uint32_t string_count; uint32_t string_count;
uint32_t chars_count; uint32_t chars_count;
FontDescriptor font; Font font;
} UILayer; } UILayer;
typedef struct UIContextStruct { typedef struct UIContextStruct {
@ -129,28 +129,6 @@ typedef struct UIContextStruct {
ComputePipeline ui_compute_text; ComputePipeline ui_compute_text;
} UIContext; } UIContext;
typedef struct UIFontStruct {
} UIFont;
typedef struct UITextStruct {
} UIText;
typedef struct UICharacterStruct {
} UICharacter;
typedef struct UIElementStruct {
uint32_t type;
uint32_t offset;
} UIElement;
typedef struct UIContainerStruct {
VkDeviceAddress elements;
} UIContainer;
typedef struct UIStruct {
} UI;
VkResult init_pipelines( VkResult init_pipelines(
VkDevice device, VkDevice device,
VmaAllocator allocator, VmaAllocator allocator,
@ -171,7 +149,7 @@ VkResult load_font(
uint32_t size, uint32_t size,
VkBool32 antialias, VkBool32 antialias,
uint32_t** charmap, uint32_t** charmap,
FontDescriptor* descriptor); Font* descriptor);
VkResult create_text_pointers( VkResult create_text_pointers(
uint32_t max_strings, uint32_t max_strings,

@ -24,7 +24,7 @@ VkResult render_thread(GLFWwindow* window, RenderContext* render_context) {
return VK_ERROR_UNKNOWN; return VK_ERROR_UNKNOWN;
} }
FontDescriptor test_font; Font test_font;
uint32_t* charmap; uint32_t* charmap;
result = load_font(render_context->device, render_context->allocator, ui_context.font_layout, ui_context.font_pool, render_context->transfer_pool, render_context->transfer_queue, library, "test.ttf", 16, VK_TRUE, &charmap, &test_font); result = load_font(render_context->device, render_context->allocator, ui_context.font_layout, ui_context.font_pool, render_context->transfer_pool, render_context->transfer_queue, library, "test.ttf", 16, VK_TRUE, &charmap, &test_font);
if(result != VK_SUCCESS) { if(result != VK_SUCCESS) {

@ -556,7 +556,7 @@ VkResult create_text_pointers(
return VK_SUCCESS; return VK_SUCCESS;
} }
VkResult load_font(VkDevice device, VmaAllocator allocator, VkDescriptorSetLayout layout, VkDescriptorPool pool,VkCommandPool transfer_pool, Queue transfer_queue, FT_Library library, const char* ttf_file, uint32_t size, VkBool32 antialias, uint32_t** charmap, FontDescriptor* descriptor) { VkResult load_font(VkDevice device, VmaAllocator allocator, VkDescriptorSetLayout layout, VkDescriptorPool pool,VkCommandPool transfer_pool, Queue transfer_queue, FT_Library library, const char* ttf_file, uint32_t size, VkBool32 antialias, uint32_t** charmap, Font* descriptor) {
FT_Face face; FT_Face face;
int error; int error;