Mercurial > molko
diff examples/example-gridmenu/example-gridmenu.c @ 459:541cb950997b
examples: add libmlk-example library
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 26 Feb 2023 19:44:47 +0100 |
parents | 773a082f0b91 |
children | 5729efd23286 |
line wrap: on
line diff
--- a/examples/example-gridmenu/example-gridmenu.c Fri Feb 24 22:14:42 2023 +0100 +++ b/examples/example-gridmenu/example-gridmenu.c Sun Feb 26 19:44:47 2023 +0100 @@ -56,13 +56,13 @@ } static void -handle(struct state *st, const union event *ev) +handle(struct state *st, const union mlk_event *ev) { struct gridmenu *menu = st->data; switch (ev->type) { - case EVENT_QUIT: - game_quit(); + case MLK_EVENT_QUIT: + mlk_game_quit(); break; default: if (gridmenu_handle(st->data, ev)) @@ -74,10 +74,10 @@ static void draw(struct state *st) { - painter_set_color(0x4f8fbaff); - painter_clear(); + mlk_painter_set_color(0x4f8fbaff); + mlk_painter_clear(); gridmenu_draw(st->data); - painter_present(); + mlk_painter_present(); } static void @@ -115,9 +115,9 @@ align(ALIGN_CENTER, &menu.x, &menu.y, menu.w, menu.h, 0, 0, W, H); - game_init(states, UTIL_SIZE(states)); - game_push(&state); - game_loop(); + mlk_game_init(states, UTIL_SIZE(states)); + mlk_game_push(&state); + mlk_game_loop(); } int