Adjustments to logger

This commit is contained in:
2024-12-31 02:07:30 -05:00
parent ddca5e8668
commit b54d336193
10 changed files with 81 additions and 39 deletions

View File

@ -231,14 +231,14 @@ startup :: proc( prof : ^SpallProfiler, persistent_mem, frame_mem, transient_mem
backend := sokol_gfx.query_backend()
switch backend
{
case .D3D11: logf("sokol_gfx: using D3D11 backend")
case .GLCORE, .GLES3: logf("sokol_gfx: using GL backend")
case .D3D11: log_fmt("sokol_gfx: using D3D11 backend")
case .GLCORE, .GLES3: log_fmt("sokol_gfx: using GL backend")
case .METAL_MACOS, .METAL_IOS, .METAL_SIMULATOR:
logf("sokol_gfx: using Metal backend")
log_fmt("sokol_gfx: using Metal backend")
case .WGPU: logf("sokol_gfx: using WebGPU backend")
case .DUMMY: logf("sokol_gfx: using dummy backend")
case .WGPU: log_fmt("sokol_gfx: using WebGPU backend")
case .DUMMY: log_fmt("sokol_gfx: using dummy backend")
}
render_data.pass_actions.bg_clear_black.colors[0] = sokol_gfx.Color_Attachment_Action {
@ -280,11 +280,11 @@ startup :: proc( prof : ^SpallProfiler, persistent_mem, frame_mem, transient_mem
// path_open_sans := strings.concatenate( { Path_Assets, "OpenSans-Regular.ttf" } )
// font_open_sans = font_load( path_open_sans, 16.0, "OpenSans" )
path_noto_sans := strings.concatenate( { Path_Assets, "NotoSans-Regular.ttf" } )
font_noto_sans = font_load( path_noto_sans, 16.0, "NotoSans" )
// path_noto_sans := strings.concatenate( { Path_Assets, "NotoSans-Regular.ttf" } )
// font_noto_sans = font_load( path_noto_sans, 16.0, "NotoSans" )
// path_neodgm_code := strings.concatenate( { Path_Assets, "neodgm_code.ttf"} )
// font_neodgm_code = font_load( path_neodgm_code, 32.0, "NeoDunggeunmo Code" )
path_neodgm_code := strings.concatenate( { Path_Assets, "neodgm_code.ttf"} )
font_neodgm_code = font_load( path_neodgm_code, 32.0, "NeoDunggeunmo Code" )
// path_rec_mono_linear := strings.concatenate( { Path_Assets, "RecMonoLinear-Regular-1.084.ttf" })
// font_rec_mono_linear = font_load( path_rec_mono_linear, 16.0, "RecMonoLinear Regular" )
@ -298,7 +298,7 @@ startup :: proc( prof : ^SpallProfiler, persistent_mem, frame_mem, transient_mem
// path_arial_unicode_ms := strings.concatenate( { Path_Assets, "Arial Unicode MS.ttf" } )
// font_arial_unicode_ms = font_load( path_arial_unicode_ms, 16.0, "Arial_Unicode_MS" )
default_font = font_noto_sans
default_font = font_neodgm_code
log( "Default font loaded" )
}
@ -354,10 +354,10 @@ startup :: proc( prof : ^SpallProfiler, persistent_mem, frame_mem, transient_mem
// debug.path_lorem = str_fmt("C:/projects/SectrPrototype/examples/ve_fontcache.h", allocator = persistent_slab_allocator())
alloc_error : AllocatorError; success : bool
debug.lorem_content, success = os.read_entire_file( debug.path_lorem, persistent_slab_allocator() )
// debug.lorem_content, success = os.read_entire_file( debug.path_lorem, persistent_slab_allocator() )
debug.lorem_parse, alloc_error = pws_parser_parse( transmute(string) debug.lorem_content, persistent_slab_allocator() )
verify( alloc_error == .None, "Faield to parse due to allocation failure" )
// debug.lorem_parse, alloc_error = pws_parser_parse( transmute(string) debug.lorem_content, persistent_slab_allocator() )
// verify( alloc_error == .None, "Faield to parse due to allocation failure" )
// Render texture test
// debug.viewport_rt = rl.LoadRenderTexture( 1280, 720 )

View File

@ -93,7 +93,7 @@ sokol_app_log_callback :: proc "c" (
}
cloned_tag := str.clone_from_cstring(tag, context.temp_allocator)
logf( "%-80s %s::%v", cloned_msg, cloned_tag, line_nr, level = odin_level )
log_fmt( "%-80s %s::%v", cloned_msg, cloned_tag, line_nr, level = odin_level )
}
// TODO(Ed): Does this need to be queued to a separate thread?
@ -113,8 +113,8 @@ sokol_app_event_callback :: proc "c" (sokol_event : ^sokol_app.Event)
switch sokol_event.type
{
case .INVALID:
logf("sokol_app - event: INVALID?")
logf("%v", sokol_event)
log_fmt("sokol_app - event: INVALID?")
log_fmt("%v", sokol_event)
case .KEY_DOWN:
if sokol_event.key_repeat do return
@ -223,8 +223,8 @@ sokol_app_event_callback :: proc "c" (sokol_event : ^sokol_app.Event)
sokol_app.consume_event()
case .DISPLAY_CHANGED:
logf("sokol_app - event: Display changed")
logf("refresh rate: %v", sokol_app.refresh_rate())
log_fmt("sokol_app - event: Display changed")
log_fmt("refresh rate: %v", sokol_app.refresh_rate())
monitor_refresh_hz := sokol_app.refresh_rate()
sokol_app.consume_event()
}
@ -274,7 +274,7 @@ sokol_gfx_log_callback :: proc "c" (
}
cloned_tag := str.clone_from_cstring(tag, context.temp_allocator)
logf( "%-80s %s::%v", cloned_msg, cloned_tag, line_nr, level = odin_level )
log_fmt( "%-80s %s::%v", cloned_msg, cloned_tag, line_nr, level = odin_level )
}
#endregion("Sokol GFX")

View File

@ -347,7 +347,7 @@ update :: proc( delta_time : f64 ) -> b32
// test_draggable()
// test_text_box()
// test_parenting( & default_layout, & frame_style_default )
test_whitespace_ast( & default_layout, & frame_style_default )
// test_whitespace_ast( & default_layout, & frame_style_default )
}
//endregion Workspace Imgui Tick