More fixes, more letters

This commit is contained in:
2024-06-15 08:20:58 -04:00
parent 5f09c22f11
commit 13f24b4ae9
6 changed files with 43 additions and 37 deletions

View File

@ -81,7 +81,7 @@ render :: proc()
{
// text_test_str := str_fmt("frametime: %v", frametime_avg_ms)
// text_test_str := str_fmt("HELLO VE FONT CACHE!!!!!")
text_test_str := str_fmt("AB")
text_test_str := str_fmt("C")
// font_provider := & state.font_provider_data
fdef := hmap_chained_get( font_cache, default_font.key )
@ -92,7 +92,7 @@ render :: proc()
ve.set_colour( & ve_font_cache, { 1.0, 1.0, 1.0, 1.0 } )
ve.configure_snap( & ve_font_cache, u32(state.app_window.extent.x * 2.0), u32(state.app_window.extent.y * 2.0) )
ve.draw_text( & ve_font_cache, fdef.ve_id, text_test_str, {0.2, 0.4}, Vec2{1 / width, 1 / height} )
ve.draw_text( & ve_font_cache, fdef.ve_id, text_test_str, {0.1, 0.2}, Vec2{1 / width, 1 / height} )
}
// Process the draw calls for drawing text
@ -111,7 +111,6 @@ render :: proc()
{
watch := draw_call
profile("ve draw call")
if (draw_call.end_index - draw_call.start_index) == 0 do continue
switch draw_call.pass
{
@ -236,8 +235,10 @@ render :: proc()
})
}
num_indices := draw_call.end_index - draw_call.start_index
sokol_gfx.draw( draw_call.start_index, num_indices, 1 )
if (draw_call.end_index - draw_call.start_index) != 0 {
num_indices := draw_call.end_index - draw_call.start_index
sokol_gfx.draw( draw_call.start_index, num_indices, 1 )
}
sokol_gfx.end_pass()
}

View File

@ -241,7 +241,7 @@ font_provider_startup :: proc()
glyph_action := PassAction {
colors = {
0 = {
load_action = .CLEAR,
load_action = .LOAD,
store_action = .STORE,
// clear_value = {0.01,0.01,0.01,1},
clear_value = {0.00, 0.00, 0.00, 1.00},
@ -506,7 +506,7 @@ font_load :: proc(path_file : string,
def.path_file = path_file
// TODO(Ed): Load even sizes from 8px to upper bound.
def.ve_id = ve.load_font( & provider_data.ve_font_cache, desired_id, font_data, 200.0 )
def.ve_id = ve.load_font( & provider_data.ve_font_cache, desired_id, font_data, 120.0 )
fid := FontID { key, desired_id }
return fid