diff --git a/include/button.h b/include/button.h new file mode 100644 index 0000000..b654ab9 --- /dev/null +++ b/include/button.h @@ -0,0 +1,16 @@ +#ifndef BUTTON_H +#define BUTTON_H + +#include "window.h" + +#define BUTTON_WIDTH 100 +#define BUTTON_HEIGHT 40 + +typedef struct button button_t; +struct button { + rect_t rect; +}; + +void draw_button(const window_t *wnd, const button_t *button); + +#endif // !BUTTON_H diff --git a/src/button.c b/src/button.c new file mode 100644 index 0000000..fea3c07 --- /dev/null +++ b/src/button.c @@ -0,0 +1,10 @@ +#include "button.h" +#include "window.h" + +#define BUTTON_FILL_COLOUR ((colour_t){.abgr = 0xff89a83c}) +#define BUTTON_BORDER_COLOUR ((colour_t){.abgr = 0xff768432}) + +void draw_button(const window_t *wnd, const button_t *button) { + fill_rect(wnd, &(button->rect), BUTTON_FILL_COLOUR); + draw_rect(wnd, &(button->rect), BUTTON_BORDER_COLOUR); +}