core/src/menu.h

#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;
	float height;
	float scroll;
} 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