Adjustments to logger
This commit is contained in:
@ -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 )
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
||||
|
@ -6,7 +6,7 @@ import ve "codebase:font/VEFontCache"
|
||||
import sokol_gfx "thirdparty:sokol/gfx"
|
||||
|
||||
Font_Provider_Use_Freetype :: false
|
||||
Font_Largest_Px_Size :: 154
|
||||
Font_Largest_Px_Size :: 72
|
||||
Font_Size_Interval :: 2
|
||||
|
||||
Font_Default :: FontID { 0, "" }
|
||||
|
@ -262,7 +262,7 @@ import "codebase:grime"
|
||||
to_odin_logger :: grime.to_odin_logger
|
||||
logger_init :: grime.logger_init
|
||||
log :: grime.log
|
||||
logf :: grime.logf
|
||||
log_fmt :: grime.log_fmt
|
||||
|
||||
// memory
|
||||
MemoryTracker :: grime.MemoryTracker
|
||||
@ -398,6 +398,10 @@ get_bounds :: proc {
|
||||
view_get_bounds,
|
||||
}
|
||||
|
||||
join :: proc {
|
||||
join_range2,
|
||||
}
|
||||
|
||||
inverse_mag :: proc {
|
||||
inverse_mag_vec3,
|
||||
// inverse_mag_rotor3,
|
||||
@ -535,6 +539,10 @@ remove_at :: proc {
|
||||
grime.array_remove_at,
|
||||
}
|
||||
|
||||
// size :: proc {
|
||||
// size_range2,
|
||||
// }
|
||||
|
||||
scope :: proc {
|
||||
ui_layout_scope_via_layout,
|
||||
ui_layout_scope_via_combo,
|
||||
|
@ -120,7 +120,7 @@ PWS_LexerData :: struct {
|
||||
pws_parser_lex :: proc ( text : string, allocator : Allocator ) -> ( PWS_LexResult, AllocatorError )
|
||||
{
|
||||
bytes := transmute([]byte) text
|
||||
log( str_fmt( "lexing: %v ...", (len(text) > 30 ? transmute(string) bytes[ :30] : text) ))
|
||||
// log( str_fmt( "lexing: %v ...", (len(text) > 30 ? transmute(string) bytes[ :30] : text) ))
|
||||
|
||||
profile(#procedure)
|
||||
using lexer : PWS_LexerData
|
||||
@ -256,7 +256,7 @@ pws_parser_parse :: proc( text : string, allocator : Allocator ) -> ( PWS_ParseR
|
||||
|
||||
tokens = lex.tokens
|
||||
|
||||
log( str_fmt( "parsing: %v ...", (len(text) > 30 ? transmute(string) bytes[ :30] : text) ))
|
||||
// log( str_fmt( "parsing: %v ...", (len(text) > 30 ? transmute(string) bytes[ :30] : text) ))
|
||||
|
||||
// TODO(Ed): Change this to use a node pool
|
||||
nodes, alloc_error = make( Array(PWS_AST), PWS_NodeArray_ReserveSize, allocator )
|
||||
|
Reference in New Issue
Block a user