battleloom-engine/src/ui.h

36 lines
847 B
C

#ifndef UI_H
#define UI_H
#include <stdbool.h>
#include <SDL2/SDL.h>
// Structure representing a button
typedef struct {
int x, y, w, h;
bool clicked;
void (*onClick)();
<<<<<<< HEAD
<<<<<<< HEAD
char text[50];
=======
>>>>>>> 206ed0e (basic ui controls)
=======
char text[50];
>>>>>>> 4b87dcb (ui)
} Button;
// Function prototypes
bool isPointInsideRect(int x, int y, SDL_Rect rect);
void handleButtonClick(SDL_Event *event, Button *button);
void handleButtonEvents(SDL_Event *event, Button buttons[], int numButtons);
<<<<<<< HEAD
<<<<<<< HEAD
void drawButtons(SDL_Renderer *renderer, Button buttons[], int numButtons, TTF_Font *font);
=======
>>>>>>> 206ed0e (basic ui controls)
=======
void drawButtons(SDL_Renderer *renderer, Button buttons[], int numButtons, TTF_Font *font);
>>>>>>> 4b87dcb (ui)
#endif /* UI_H */