-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.h
More file actions
54 lines (50 loc) · 977 Bytes
/
Copy pathgui.h
File metadata and controls
54 lines (50 loc) · 977 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef GUI_H
#define GUI_H
#include "rendering.h"
const int SLIDER_RADIUS=10;
template <class T>
class Button {
private:
int x,y;
float w,h;
bool highlighted;
T val;
public:
Button();
Button(int,int,float,float,T);
~Button();
void init(int,int,float,float,T);
bool checkMouse(int,int);
int getX();
int getY();
float getWidth();
float getHeight();
bool isHighlighted();
T getValue();
};
template <class T>
class Slider {
private:
int x,y; // original position
int offsetx; // slid position
int lastX;
T value;
T min,max;
T inc;
bool clicked;
bool hovering;
public:
Slider();
Slider(int,int,T,T,T); // x, y, min, max, inc
~Slider();
bool checkMouse(int,int);
bool slide(int);
void render(Window&);
void setClicked(bool);
void setHovering(bool);
T getValue();
int getClicked();
int getLastX();
int getHovering();
};
#endif