diff options
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 |