From e806d41c8703ddc4bcaf2186d0c1701bd1e1ada3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 22 Dec 2021 12:16:38 +0000 Subject: Initial commit with some basic UI --- ui/iconButton.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ui/iconButton.h (limited to 'ui/iconButton.h') diff --git a/ui/iconButton.h b/ui/iconButton.h new file mode 100644 index 0000000..ec3f357 --- /dev/null +++ b/ui/iconButton.h @@ -0,0 +1,27 @@ +#ifndef ICONBUTTON_H +#define ICONBUTTON_H + +#include "icon.h" +#include "uiComponent.h" +#include +#include +#include + +class UIShader; +union SDL_Event; + +static const constexpr glm::vec2 ICON_SIZE {32.F, 32.F}; +class IconButton : public UIComponent { +public: + IconButton(const std::string & icon, glm::vec2 position, UIEvent click); + + void render(const UIShader &, const Position & parentPos) const override; + + bool handleInput(const SDL_Event & e, const Position & parentPos) override; + + Icon icon; + UIEvent click; + GLuint m_vertexArrayObject, m_vertexArrayBuffer; +}; + +#endif -- cgit v1.2.3