[WIP] Add descriptors and pipeline builder
This commit is contained in:
1 parent
173a82b9d1
commit
f8eb98ddf4
36 files changed
+613
-458
No files matched your search
@@ -3,7 +3,6 @@
|
||||
#include <strings.h>
|
||||
|
||||
#include "freetype/fttypes.h"
|
||||
#include "locale_fonts.h"
|
||||
#include "font_errors.h"
|
||||
#include "src/mesh_controller.h"
|
||||
#include "src/math.h"
|
||||
@@ -11,6 +10,7 @@
|
||||
#include "utilities/logger.h"
|
||||
#include "utilities/commons.h"
|
||||
#include "utilities/errors_common.h"
|
||||
#include "utilities/localization.h"
|
||||
#include "vulkan_image.h"
|
||||
|
||||
#include "vulkan/vulkan_core.h"
|
||||
@@ -52,7 +52,7 @@ rse_err_t fonts_initialize()
|
||||
}
|
||||
|
||||
|
||||
rse_err_t fonts_load_from_file(const char* file_path)
|
||||
rse_err_t fonts_load_from_file(struct graphics_context_t* context, const char* file_path)
|
||||
{
|
||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||
FT_Error error;
|
||||
@@ -110,9 +110,9 @@ rse_err_t fonts_load_from_file(const char* file_path)
|
||||
{g_fonts_data[iter].bearing_x, g_fonts_data[iter].height, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 1.0f}
|
||||
};
|
||||
|
||||
g_fonts_data[iter].mesh_id = create_mesh(font_vertices, font_indices, 8, 6);
|
||||
g_fonts_data[iter].mesh_id = create_mesh(context, font_vertices, font_indices, 8, 6);
|
||||
|
||||
STATUS_CHECK(load_texture_from_bitmat(face->glyph->bitmap.buffer,
|
||||
STATUS_CHECK(load_texture_from_bitmat(context, face->glyph->bitmap.buffer,
|
||||
face->glyph->bitmap.width,
|
||||
face->glyph->bitmap.rows,
|
||||
&g_fonts_data[iter].texture_id, VK_FORMAT_R8_SRGB));
|
||||
@@ -121,7 +121,7 @@ rse_err_t fonts_load_from_file(const char* file_path)
|
||||
return status;
|
||||
}
|
||||
|
||||
rse_err_t print_text(const char* text, struct vec3_t position, float font_size)
|
||||
rse_err_t print_text(struct graphics_context_t* context, const char* text, struct vec3_t position, float font_size)
|
||||
{
|
||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||
size_t iter = 0U;
|
||||
@@ -140,7 +140,7 @@ rse_err_t print_text(const char* text, struct vec3_t position, float font_size)
|
||||
|
||||
x_pos = position.x + advance - (g_fonts_data[charactet_code].bearing_x * scale);
|
||||
y_pos = position.y - (g_fonts_data[charactet_code].bearing_y * scale);
|
||||
create_mesh_instance(g_fonts_data[charactet_code].mesh_id, (struct instance_data_t){
|
||||
create_mesh_instance(context, g_fonts_data[charactet_code].mesh_id, (struct instance_data_t){
|
||||
{x_pos, y_pos, 0.0f},
|
||||
{0.0f, 0.0f, math_deg_to_radians(0.0f)},
|
||||
FONT_SCALING * font_size,
|
||||
|
||||
Reference in new issue
Block a user