handle window resizes
This commit is contained in:
16
edit.jai
16
edit.jai
@@ -38,6 +38,21 @@ main :: () {
|
|||||||
|
|
||||||
Input.update_window_events();
|
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 {
|
for event : Input.events_this_frame {
|
||||||
if event.type == .QUIT {
|
if event.type == .QUIT {
|
||||||
should_quit = true;
|
should_quit = true;
|
||||||
@@ -129,7 +144,6 @@ read_file_lines :: (file_path: string) -> bool {
|
|||||||
my_init_fonts :: () {
|
my_init_fonts :: () {
|
||||||
line_height = 16;
|
line_height = 16;
|
||||||
base_path := path_strip_filename(get_path_of_running_executable());
|
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("/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);
|
// my_font = Simp.get_font_at_size(base_path, "Anonymous Pro.ttf", line_height);
|
||||||
|
|||||||
Reference in New Issue
Block a user