Singleton class that handles global input state.
More...
#include <src/app/InputManager.h>
|
| static void | keyCallback (GLFWwindow *pWindow, int iKey, int iScanCode, int iAction, int iMods) |
| |
| static void | mouseButtonCallback (GLFWwindow *pWindow, int iButton, int iAction, int iMods) |
| |
| static void | mousePosCallback (GLFWwindow *pWindow, double dXPos, double dYPos) |
| |
| static void | scrollCallback (GLFWwindow *pWindow, double dXOffset, double dYOffset) |
| |
Singleton class that handles global input state.
◆ InputManager()
| InputManager::InputManager |
( |
| ) |
|
|
privatedefault |
◆ FrameBufferSizeCallback()
| void InputManager::FrameBufferSizeCallback |
( |
GLFWwindow * |
window, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
static |
◆ GetInstance()
Retrieves the singleton instance.
◆ GetMouseDelta()
◆ GetMousePosition()
| Core::Vec3 InputManager::GetMousePosition |
( |
| ) |
const |
|
inline |
◆ GetScroll()
| double InputManager::GetScroll |
( |
| ) |
const |
|
inline |
◆ Init()
| void InputManager::Init |
( |
GLFWwindow * |
pWindow | ) |
|
Initializes input callbacks for the specified window.
- Parameters
-
| pWindow | The GLFW window handle. |
◆ IsKeyJustPressed()
| bool InputManager::IsKeyJustPressed |
( |
int |
iKey | ) |
const |
◆ IsKeyPressed()
| bool InputManager::IsKeyPressed |
( |
int |
iKey | ) |
const |
◆ IsMouseButtonPressed()
| bool InputManager::IsMouseButtonPressed |
( |
int |
iButton | ) |
const |
◆ keyCallback()
| void InputManager::keyCallback |
( |
GLFWwindow * |
pWindow, |
|
|
int |
iKey, |
|
|
int |
iScanCode, |
|
|
int |
iAction, |
|
|
int |
iMods |
|
) |
| |
|
staticprivate |
◆ mouseButtonCallback()
| void InputManager::mouseButtonCallback |
( |
GLFWwindow * |
pWindow, |
|
|
int |
iButton, |
|
|
int |
iAction, |
|
|
int |
iMods |
|
) |
| |
|
staticprivate |
◆ mousePosCallback()
| void InputManager::mousePosCallback |
( |
GLFWwindow * |
pWindow, |
|
|
double |
dXPos, |
|
|
double |
dYPos |
|
) |
| |
|
staticprivate |
◆ scrollCallback()
| void InputManager::scrollCallback |
( |
GLFWwindow * |
pWindow, |
|
|
double |
dXOffset, |
|
|
double |
dYOffset |
|
) |
| |
|
staticprivate |
◆ Update()
| void InputManager::Update |
( |
| ) |
|
Updates internal state (previous keys, mouse delta) at the start of a frame.
- Note
- Must be called BEFORE glfwPollEvents() for IsKeyJustPressed to work correctly.
◆ m_bButtons
| bool InputManager::m_bButtons[8] = {false} |
|
private |
◆ m_bFirstMouse
| bool InputManager::m_bFirstMouse = false |
|
private |
◆ m_bKeys
| bool InputManager::m_bKeys[1024] = {false} |
|
private |
◆ m_bPrevKeys
| bool InputManager::m_bPrevKeys[1024] = {false} |
|
private |
◆ m_dScrollY
| double InputManager::m_dScrollY = 0.0 |
|
private |
◆ m_objMouseDelta
◆ m_objMousePosition
◆ m_objMousePrevPosition
The documentation for this class was generated from the following files: