diff options
author | Marvin Borner | 2020-09-13 11:12:20 +0200 |
---|---|---|
committer | Marvin Borner | 2020-09-13 11:12:20 +0200 |
commit | e55f8e9039b5be5f3750639dad0ae5058adc8449 (patch) | |
tree | cc1731e95dae0760b80f1956a60fc97adedbf3d9 /apps/window.c | |
parent | 8b8a4d9a9971706082b8db2c18b978d20b00d2f6 (diff) |
Less malloc in wm
Diffstat (limited to 'apps/window.c')
-rw-r--r-- | apps/window.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/window.c b/apps/window.c index a1311a0..0d503de 100644 --- a/apps/window.c +++ b/apps/window.c @@ -11,14 +11,15 @@ int main() { print("[test window loaded]\n"); - struct window *win = gui_new_window(WF_DEFAULT); + struct window win = { 0 }; + gui_new_window(&win); - gui_fill(win, BG_COLOR); - gui_border(win, FG_COLOR, 2); + gui_fill(&win, BG_COLOR); + gui_border(&win, FG_COLOR, 2); gui_init("/font/spleen-12x24.psfu"); char *hello = "Hello, world!"; - gui_write(win, win->width / 2 - (strlen(hello) * 12) / 2, 5, FG_COLOR, hello); + gui_write(&win, win.width / 2 - (strlen(hello) * 12) / 2, 5, FG_COLOR, hello); event_register(EVENT_KEYBOARD); struct message *msg; @@ -44,7 +45,7 @@ int main() char_x = 0; char_y++; } else if (KEY_ALPHABETIC(key)) { - gui_write_char(win, 12 * char_x++, 24 * char_y + 5, FG_COLOR, 'a'); + gui_write_char(&win, 12 * char_x++, 24 * char_y + 5, FG_COLOR, 'a'); } break; |