summaryrefslogtreecommitdiff
path: root/ui/iconButton.h
blob: 76e3f1b94586479687ad44fb2a76802879d6ffff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef ICONBUTTON_H
#define ICONBUTTON_H

#include "icon.h"
#include "uiComponent.h"
#include <glBuffers.h>
#include <glVertexArrays.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;
	glVertexArray m_vertexArrayObject;
	glBuffer m_vertexArrayBuffer;
};

#endif