basic ui controls

This commit is contained in:
Rysertio 2024-02-21 09:46:44 +06:00
parent 17fdac54f4
commit c690a9e083
2 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,7 @@ void handleButtonEvents(SDL_Event *event, Button buttons[], int numButtons) {
for (int i = 0; i < numButtons; i++) {
handleButtonClick(event, &buttons[i]);
}
<<<<<<< HEAD
}
void drawButtons(SDL_Renderer *renderer, Button buttons[], int numButtons, TTF_Font *font) {
@ -65,3 +66,6 @@ void drawButtons(SDL_Renderer *renderer, Button buttons[], int numButtons, TTF_F
// Present renderer
SDL_RenderPresent(renderer);
}
=======
}
>>>>>>> 206ed0e (basic ui controls)

View File

@ -9,13 +9,19 @@ typedef struct {
int x, y, w, h;
bool clicked;
void (*onClick)();
<<<<<<< HEAD
char text[50];
=======
>>>>>>> 206ed0e (basic ui controls)
} 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
void drawButtons(SDL_Renderer *renderer, Button buttons[], int numButtons, TTF_Font *font);
=======
>>>>>>> 206ed0e (basic ui controls)
#endif /* UI_H */