TheAtlasEngine
Loading...
Searching...
No Matches
event.hpp
1
#pragma once
2
#include <core/event/key_codes.hpp>
3
#include <core/event/mouse_codes.hpp>
4
#include <glm/glm.hpp>
5
#include <map>
6
#include <string>
7
8
namespace
atlas::event {
17
enum
input_state { None, Idle, Pressed, Released };
18
19
struct
joystick_button
{
20
int
ID = -1;
21
std::string Name =
""
;
22
input_state ButtonState = input_state::None;
23
input_state PreviousButtonState = input_state::None;
24
};
25
26
struct
joystick_info
{
27
int
ID = -1;
28
std::string JoystickName =
"Default"
;
29
std::map<int, joystick_button> Buttons;
30
std::map<int, bool> ButtonsDown;
31
std::map<int, const float*> AxesOfController;
32
};
33
34
bool
is_key_pressed(
int
p_key);
35
36
bool
is_key_released(
int
p_key);
37
38
bool
is_mouse_pressed(
int
p_mouse_code);
39
bool
is_mouse_released(
int
p_mouse_code);
40
41
glm::vec2 cursor_position();
42
43
// joystic-specific functions
44
45
bool
is_joystic_present(
int
p_controller_id);
46
47
const
char
* is_joystick_guid(
int
p_controller_id);
48
49
float
get_joystic_axis(
int
p_controller_id,
int
p_button);
50
51
// bool is_button_pressed(int p_button_id, int p_controller_id);
52
53
// bool is_button_released(int p_button_id, int p_controller_id);
54
56
bool
is_joystick_button_pressed(
int
p_button);
57
58
bool
is_joystick_button_released(
int
p_button);
59
60
// specific for listening events
61
void
update_events();
62
63
void
wait_for_events();
64
};
// namespace atlas::event
atlas::event::joystick_button
Definition
event.hpp:19
atlas::event::joystick_info
Definition
event.hpp:26
TheAtlasEngine
atlas
core
event
event.hpp
Generated by
1.9.8