handle window resizes

This commit is contained in:
2026-04-21 16:04:13 -04:00
parent 3a9784d0c8
commit c41bb88e8e

View File

@@ -38,6 +38,21 @@ main :: () {
Input.update_window_events();
for Input.get_window_resizes() {
Simp.update_window(it.window);
if it.window == window {
should_reinit := (it.width != window_width) || (it.height != window_height);
window_width = it.width;
window_height = it.height;
if should_reinit {
my_init_fonts();
}
}
}
for event : Input.events_this_frame {
if event.type == .QUIT {
should_quit = true;
@@ -129,7 +144,6 @@ read_file_lines :: (file_path: string) -> bool {
my_init_fonts :: () {
line_height = 16;
base_path := path_strip_filename(get_path_of_running_executable());
print("base_path: %\n", base_path);
my_font = Simp.get_font_at_size("/home/grant/.local/share/fonts/otf/BerkeleyMono/", "BerkeleyMono-Regular.otf", line_height);
// my_font = Simp.get_font_at_size(base_path, "Anonymous Pro.ttf", line_height);