haha, init the arrays first

main
Patrick Cleavelin 2024-03-20 17:36:18 -05:00
parent 20f6e2f2dc
commit 6b94f0dbde
1 changed files with 5 additions and 4 deletions

View File

@ -89,6 +89,11 @@ void ed_init(_gfx_frame_func frame_func) {
// NOTE: the order of these matter
gfx_push_vertex_buffer(state.gfx_cx, vertices, sizeof(vertices));
gfx_push_vertex_buffer(state.gfx_cx, indices, sizeof(indices));
state.gpu_ui_rects = newArray(GpuUiRect, 2000);
state.gpu_glyphs = newArray(GpuGlyph, 1024);
state.glyph_cache = newArray(GpuGlyph, 97);
gfx_allocate_vertex_buffer(state.gfx_cx, state.gpu_glyphs.capacity * sizeof(GpuGlyph));
gfx_allocate_vertex_buffer(state.gfx_cx, sizeof(GpuUniformParams));
@ -109,10 +114,6 @@ void ed_init(_gfx_frame_func frame_func) {
const int rasterized_font_height = 64;
uint8_t *font_bitmap = context_alloc(font_bitmap_size*font_bitmap_size * sizeof(uint8_t));
state.gpu_ui_rects = newArray(GpuUiRect, 2000);
state.gpu_glyphs = newArray(GpuGlyph, 1024);
state.glyph_cache = newArray(GpuGlyph, 97);
int ascent, descent, line_gap;
float scale = stbtt_ScaleForPixelHeight(&font, rasterized_font_height);
stbtt_GetFontVMetrics(&font, &ascent, &descent, &line_gap);