2018-02-02 16:16:55 +01:00
|
|
|
#ifndef GUI_BUTTON_H_
|
|
|
|
#define GUI_BUTTON_H_
|
|
|
|
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
#include "pointer.h"
|
|
|
|
#include "sprite.h"
|
|
|
|
#include "linkedlist.h"
|
|
|
|
#include "camera.h"
|
|
|
|
|
|
|
|
typedef struct GuiButton_t {
|
|
|
|
SDL_Rect area;
|
|
|
|
bool hover;
|
2018-02-02 17:05:41 +01:00
|
|
|
void *usrdata;
|
|
|
|
void (*event)(void*);
|
2018-02-02 16:16:55 +01:00
|
|
|
} GuiButton;
|
|
|
|
|
|
|
|
GuiButton *
|
2018-02-02 17:05:41 +01:00
|
|
|
gui_button_create(SDL_Rect, void (*)(void*), void*);
|
2018-02-02 16:16:55 +01:00
|
|
|
|
|
|
|
void
|
|
|
|
gui_button_check_pointer(GuiButton*, Pointer*);
|
|
|
|
|
2018-02-02 17:05:41 +01:00
|
|
|
void
|
|
|
|
gui_button_handle_event(GuiButton*, SDL_Event*);
|
|
|
|
|
2018-02-02 16:16:55 +01:00
|
|
|
void
|
|
|
|
gui_button_destroy(GuiButton*);
|
|
|
|
|
|
|
|
#endif // GUI_BUTTON_H_
|