Input::Input |
( |
shared_ptr< GLFWwindow > |
w | ) |
|
Constructor for a window handle
bool Input::getKey |
( |
int |
keyCode | ) |
|
|
static |
Returns true if the key IS pressed (every frame that the key is pressed)
bool Input::getKeyPressed |
( |
int |
keyCode | ) |
|
|
static |
Returns true if the key was pressed (1st frame only)
bool Input::getKeyReleased |
( |
int |
keyCode | ) |
|
|
static |
Returns true if the key was pressed (release frame only)
bool Input::getMouseButton |
( |
int |
keyCode | ) |
|
|
static |
Returns true if the mouse button IS pressed (every frame that the mouse button is pressed)
bool Input::getMouseButtonPressed |
( |
int |
keyCode | ) |
|
|
static |
Returns true if the mouse button was pressed (1st frame only)
bool Input::getMouseButtonReleased |
( |
int |
keyCode | ) |
|
|
static |
Returns true if the mouse button was pressed (release frame only)
static shared_ptr<GLFWwindow> Input::getWindow |
( |
| ) |
|
|
static |
static void Input::setWindow |
( |
shared_ptr< GLFWwindow > |
window | ) |
|
|
static |
void Input::updateInputState |
( |
| ) |
|
|
static |
Updates the state of input. Swaps the old/new and gets the new input state
Uses move to prevend copying arrays
Get updated value from GLFW for keyboard state
Uses move to prevend copying arrays
Get updated value from GLFW for mouse state
Updates mouse position
std::array< int, Input::nKeys > Input::keyboardInputState = { 0 } |
|
static |
Keyboard state of all keyboard keys on current frame
glm::vec2 Input::lastMousePos |
|
static |
Last mouse position x,y on screen
glm::vec2 Input::mouseDelta |
|
static |
Mouse position delta, x,y on screen
std::array< int, Input::nMouseButtons > Input::mouseInputState = { 0 } |
|
static |
Keyboard state of all mouse buttons on current frame
glm::vec2 Input::mousePos |
|
static |
Current mouse position x,y on screen
std::array< int, Input::nKeys > Input::oldKeyboardInputState = { 0 } |
|
static |
Keyboard state of all keyboard keys on last frame
std::array< int, Input::nMouseButtons > Input::oldMouseInputState = { 0 } |
|
static |
Keyboard state of all mouse buttons on last frame
The documentation for this class was generated from the following files:
- /Users/guilherme_cunha/Dev/GITHUB/GUInity/Source/Input.hpp
- /Users/guilherme_cunha/Dev/GITHUB/GUInity/Source/Input.cpp