Hot reload works

This commit is contained in:
2024-01-22 03:47:53 -05:00
parent 77a48d7104
commit 761794f594
6 changed files with 147 additions and 80 deletions

View File

@ -1,19 +1,20 @@
package sectr
import "core:unicode/utf8"
import "core:unicode/utf8"
import rl "vendor:raylib"
font_rec_mono_semicasual_reg : Font;
default_font : Font
debug_text :: proc( content : string, x, y : f32, size : f32 = 16.0, color : rl.Color = rl.WHITE, font : rl.Font = default_font )
debug_text :: proc( content : string, x, y : f32, size : f32 = 16.0, color : rl.Color = rl.WHITE, font : rl.Font = {} )
{
if len( content ) == 0 {
return
}
runes := utf8.string_to_runes( content, context.temp_allocator )
font := font
if ( font.chars == nil ) {
font = ( cast( ^ State) memory.persistent ).default_font
}
rl.DrawTextCodepoints( font,
raw_data(runes), cast(i32) len(runes),
position = rl.Vector2 { x, y },