Mercurial > molko
diff examples/example-ui.c @ 156:c3a40062acc2
misc: create more generic startup function, closes #2500
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 16 Oct 2020 13:54:31 +0200 |
parents | aa6e70e330a1 |
children | 31d7f23c0588 |
line wrap: on
line diff
--- a/examples/example-ui.c Fri Oct 16 13:15:04 2020 +0200 +++ b/examples/example-ui.c Fri Oct 16 13:54:31 2020 +0200 @@ -18,6 +18,7 @@ #include <core/action.h> #include <core/clock.h> +#include <core/core.h> #include <core/event.h> #include <core/maths.h> #include <core/panic.h> @@ -32,6 +33,7 @@ #include <ui/frame.h> #include <ui/label.h> #include <ui/theme.h> +#include <ui/ui.h> #define W (1280) #define H (720) @@ -126,9 +128,9 @@ static void init(void) { - if (!sys_init() || - !window_init("Example - UI", W, H) || - !theme_init()) + if (!core_init() || !ui_init()) + panic(); + if (!window_open("Example - UI", W, H)) panic(); } @@ -283,9 +285,9 @@ static void quit(void) { - theme_finish(); window_finish(); - sys_finish(); + ui_finish(); + core_finish(); } int