diff options
author | quou <quou@disroot.org> | 2023-05-06 09:02:04 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2023-05-06 09:02:04 +1000 |
commit | 2ab411c4b8855d11d48454a93262e8eae3ba7fc7 (patch) | |
tree | e608ebd0bea71570be0a3619f9848f975669e5ef /menu.h | |
parent | fb104368dd33b66e0575dcc0327cbae7046a4e1e (diff) |
Menus, game over, dying, etc.
Diffstat (limited to 'menu.h')
-rw-r--r-- | menu.h | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -0,0 +1,35 @@ +#ifndef menu_h +#define menu_h + +#include "config.h" +#include "render.h" + +typedef struct Menu Menu; + +typedef void (*Menu_Event)(Menu* menu); + +typedef struct { + Menu_Event on_select; + int text_len; + char text[20]; +} Menu_Item; + +struct Menu { + Menu_Item els[menu_max_elements]; + int el_count; + int selected; + int y, h; + void* ptr; +}; + +void init_menu(Menu* menu, void* ptr); +void menu_add( + Menu* menu, + const char* text, + Menu_Event on_select, + const BM_Font* font +); +void update_menu(Menu* menu); +void render_menu(Menu* menu, const BM_Font* font); + +#endif |