Vivid
|
A namespace that contains functions to handle input. More...
Functions | |
bool | IsKeyPressed (int key) |
Checks if a key is pressed or not. | |
Vivid::Maths::Vec2 | GetMousePosition () |
Gets the mouse position. | |
Vivid::Maths::Vec2 | GetMousePositionOnViewport () |
Gets the mouse position on the viewport. | |
bool | IsMouseButtonPressed (int button) |
Checks if a mouse button is pressed or not. | |
A namespace that contains functions to handle input.
This namespace contains functions to check if a key is pressed or not, get the mouse position, get the mouse position on the viewport, and check if a mouse button is pressed or not.
Vivid::Maths::Vec2 InputHandler::GetMousePosition | ( | ) |
Gets the mouse position.
Gets an Application singelton and then gets the GLFW window from it and gets the mouse position.
Definition at line 13 of file InputHandler.cpp.
Vivid::Maths::Vec2 InputHandler::GetMousePositionOnViewport | ( | ) |
Gets the mouse position on the viewport.
Gets the mouse position and then subtracts the viewport position from it and then returns the mouse position.
Definition at line 30 of file InputHandler.cpp.
bool InputHandler::IsKeyPressed | ( | int | key | ) |
Checks if a key is pressed or not.
Gets an Application singelton and then gets the GLFW window from it and checks if the key is pressed or not.
key | The key to check if it is pressed or not. key is a GLFW key code. |
Definition at line 5 of file InputHandler.cpp.
bool InputHandler::IsMouseButtonPressed | ( | int | button | ) |
Checks if a mouse button is pressed or not.
Gets an Application singelton and then gets the GLFW window from it and checks if the mouse button is pressed or not.
button | The mouse button to check if it is pressed or not. button is a GLFW mouse button code. |
Definition at line 22 of file InputHandler.cpp.