-
Notifications
You must be signed in to change notification settings - Fork 2
/
Input.cpp
66 lines (50 loc) · 1.53 KB
/
Input.cpp
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
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include "event/InputHandler.h"
namespace ptgn {
namespace input {
void Update() {
auto& input_handler{ services::GetInputHandler() };
input_handler.Update();
}
V2_int GetMouseScreenPosition() {
auto& input_handler{ services::GetInputHandler() };
return input_handler.GetMouseScreenPosition();
}
V2_int GetMouseAbsolutePosition() {
auto& input_handler{ services::GetInputHandler() };
return input_handler.GetMouseAbsolutePosition();
}
bool MousePressed(Mouse button) {
auto& input_handler{ services::GetInputHandler() };
return input_handler.MousePressed(button);
}
bool MouseReleased(Mouse button) {
auto& input_handler{ services::GetInputHandler() };
return input_handler.MouseReleased(button);
}
bool MouseDown(Mouse button) {
auto& input_handler{ services::GetInputHandler() };
return input_handler.MouseDown(button);
}
bool MouseUp(Mouse button) {
auto& input_handler{ services::GetInputHandler() };
return input_handler.MouseUp(button);
}
bool KeyPressed(Key key) {
auto& input_handler{ services::GetInputHandler() };
return input_handler.KeyPressed(key);
}
bool KeyReleased(Key key) {
auto& input_handler{ services::GetInputHandler() };
return input_handler.KeyReleased(key);
}
bool KeyDown(Key key) {
auto& input_handler{ services::GetInputHandler() };
return input_handler.KeyDown(key);
}
bool KeyUp(Key key) {
auto& input_handler{ services::GetInputHandler() };
return input_handler.KeyUp(key);
}
} // namespace input
} // namespace ptgn