/
Inputs.hpp
55 lines (46 loc) · 956 Bytes
/
Inputs.hpp
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
55
#ifndef inputs_hpp
#define inputs_hpp
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
/*
class storing informations about inputs
for better performance
*/
class Inputs
{
Inputs() {};
Inputs(const Inputs & ) {};
sf::Vector2f mouse_pos;
public:
static Inputs & getInputs()
{
static Inputs singleton;
return singleton;
}
static sf::RenderWindow * win;
bool mouse_state[sf::Mouse::ButtonCount];
/*enum Mouse
{
MOUSE_LEFT = sf::Mouse::Left,
MOUSE_RIGHT = sf::Mouse::Right,
MOUSE_MIDDLE = sf::Mouse::Middle
};*/
/*
enum
{
MOUSE_LEFT,
MOUSE_MID,
MOUSE_RIGHT,
KEY_X,
KEY_DEL,
KEY_N,
KEY_L,
KEY_LCTRL,
KEY_LSHIFT,
};*/
void update();
bool get(sf::Mouse::Button button);
sf::Vector2f mousePos();
sf::Vector2f mousePosOnWindow();
};
#endif // inputs_hpp