summaryrefslogtreecommitdiff
path: root/src/menu.h
diff options
context:
space:
mode:
authorraven <citrons@mondecitronne.com>2026-04-09 18:50:16 -0500
committerraven <citrons@mondecitronne.com>2026-04-09 18:51:00 -0500
commit75920242a0efd749bf88fe1eb9a51946bb2a2365 (patch)
tree0f5d35717b915b74e59161c69a722ada7b42123a /src/menu.h
parent18a86e1038b20cb6f8922beead08dcc24ba2a4d3 (diff)
context menu to jump to different mappings
Diffstat (limited to 'src/menu.h')
-rw-r--r--src/menu.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/menu.h b/src/menu.h
new file mode 100644
index 0000000..1c6cbd1
--- /dev/null
+++ b/src/menu.h
@@ -0,0 +1,26 @@
+#ifndef MENU_H
+#define MENU_H
+
+#include <SDL3/SDL.h>
+#include <stdbool.h>
+
+typedef struct menu_entry {
+ char name[64];
+ void (*action)(void *data);
+ void *data;
+} menu_entry;
+
+typedef struct menu {
+ SDL_Window *window;
+ SDL_Renderer *renderer;
+ menu_entry *entries;
+ SDL_Texture **textures;
+ int count;
+} menu;
+
+menu *create_menu(menu_entry *entries, int count, int x, int y);
+bool menu_handle_event(menu *m, SDL_Event e);
+void menu_render(menu *m);
+void close_menu(menu *m);
+
+#endif