diff options
Diffstat (limited to 'ui/iconButton.h')
-rw-r--r-- | ui/iconButton.h | 27 |
1 files changed, 27 insertions, 0 deletions
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 <GL/glew.h> +#include <glm/glm.hpp> +#include <string> + +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 |