❖
Monad Engine
da02fba2
>
Undercity Codex
_
Loading...
Searching...
No Matches
InputManager.h
Go to the documentation of this file.
1
#pragma once
2
#include <array>
3
#include <glm/vec2.hpp>
4
5
namespace
eng
6
{
7
class
InputManager
8
{
9
private
:
10
InputManager
() =
default
;
11
InputManager
(
const
InputManager
&) =
delete
;
12
InputManager
(
InputManager
&&) =
delete
;
13
InputManager
& operator=(
const
InputManager
&) =
delete
;
14
InputManager
& operator=(
InputManager
&&) =
delete
;
15
16
public
:
17
void
SetKeyPressed
(
int
key,
bool
pressed);
18
bool
IsKeyPressed
(
int
key);
19
20
void
SetMouseButtonPressed
(
int
button,
bool
pressed);
21
bool
IsMouseButtonPressed
(
int
button);
22
23
void
SetMousePositionOld
(
const
glm::vec2& pos);
24
const
glm::vec2&
GetMousePositionOld
()
const
;
25
26
void
SetMousePositionCurrent
(
const
glm::vec2& pos);
27
const
glm::vec2&
GetMousePositionCurrent
()
const
;
28
29
void
SetMousePositionChanged
(
bool
changed);
30
bool
IsMousePositionChanged
()
const
;
31
32
private
:
33
std::array<bool, 256> m_keys = {
false
};
34
std::array<bool, 16> m_mouseKeys = {
false
};
35
glm::vec2 m_mousePositionOld = glm::vec2(0.0f);
36
glm::vec2 m_mousePositionCurrent = glm::vec2(0.0f);
37
bool
m_mousePositionChanged =
false
;
38
39
friend
class
Engine
;
40
};
41
}
eng::Engine
Definition
Engine.h:19
eng::InputManager
Definition
InputManager.h:8
eng::InputManager::IsKeyPressed
bool IsKeyPressed(int key)
Definition
InputManager.cpp:14
eng::InputManager::SetMousePositionChanged
void SetMousePositionChanged(bool changed)
Definition
InputManager.cpp:62
eng::InputManager::GetMousePositionCurrent
const glm::vec2 & GetMousePositionCurrent() const
Definition
InputManager.cpp:57
eng::InputManager::SetMousePositionCurrent
void SetMousePositionCurrent(const glm::vec2 &pos)
Definition
InputManager.cpp:52
eng::InputManager::SetKeyPressed
void SetKeyPressed(int key, bool pressed)
Definition
InputManager.cpp:5
eng::InputManager::IsMousePositionChanged
bool IsMousePositionChanged() const
Definition
InputManager.cpp:67
eng::InputManager::SetMouseButtonPressed
void SetMouseButtonPressed(int button, bool pressed)
Definition
InputManager.cpp:24
eng::InputManager::SetMousePositionOld
void SetMousePositionOld(const glm::vec2 &pos)
Definition
InputManager.cpp:42
eng::InputManager::GetMousePositionOld
const glm::vec2 & GetMousePositionOld() const
Definition
InputManager.cpp:47
eng::InputManager::IsMouseButtonPressed
bool IsMouseButtonPressed(int button)
Definition
InputManager.cpp:33
eng
Definition
Application.cpp:4
docs
GD-Engine-lesson-5-2
engine
source
input
InputManager.h
Generated by
1.9.8