diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-01-25 08:46:49 -0500 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-01-25 08:46:49 -0500 |
commit | 70eaac72ef917784cba10184a1df7c25d179d541 (patch) | |
tree | eeaccf047e920f8e127799ce0db9699ce10daa1f /include/ui.h | |
parent | 9c3e9dccdbb5804b47a3ecd5ca50ca3d424dab21 (diff) |
Menus!
Diffstat (limited to 'include/ui.h')
-rw-r--r-- | include/ui.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/ui.h b/include/ui.h index c018008..030c73d 100644 --- a/include/ui.h +++ b/include/ui.h @@ -10,12 +10,42 @@ #include <world.h> #include <ft2build.h> +#include <SDL2/SDL_opengl.h> #include FT_FREETYPE_H #define DEBUG +typedef void(*menuFunc)(); + + +struct menuItem{ + int member; + union{ + + struct{ + vec2 loc; + dim2 dim; + Color color; + const char* text; + menuFunc func; + }button; + + struct{ + vec2 loc; + dim2 dim; + Color color; + float minValue; + float maxValue; + const char* text; + void* var; + }slider; + + }; +}; + namespace ui { + menuItem createButton(vec2 l, dim2 d, Color c, const char* t, menuFunc f); /** * Contains the coordinates of the mouse inside the window. */ @@ -26,6 +56,8 @@ namespace ui { * These flags are used elsewhere. */ + extern bool pMenu; + extern bool menu; extern bool debug; extern bool posFlag; extern unsigned int fontSize; @@ -83,6 +115,15 @@ namespace ui { void draw(void); + + /* + * Draw various menu items + */ + void quitGame(); + void quitMenu(); + void drawMenu(std::vector<menuItem>mi); + + /* * Handle keyboard/mouse events. */ |