Simple Game Graphics Library
1.0
|
Functions | |
void | graphics::getMouseState (MouseState &ms) |
bool | graphics::getKeyState (scancode_t key) |
bool graphics::getKeyState | ( | scancode_t | key | ) |
Polls the engine for the current state of a specific key.
Since buttons can be queried individually, multiple pressed keys can be detected, by querying each one of them. The function shall return true if a button has been reported as pressed by a window event between the previous call to the update function and the current call to getKeyState().
key | is the scancode ID of the key to query. The available scancodes are listed in the scancodes.h file. |
void graphics::getMouseState | ( | MouseState & | ms | ) |
Polls the engine for the current state of the mouse.
Stores in the user-provided MouseState record ms, the current status of all mouse events. For more information on what data can be obtained, see the MouseState structure. Typically, this function is used from within the update callback of the application.
ms | is the user-provided record to update with the current status of the mouse cursor button and higher-level information such as mouse "dragging" and button "pressed / released". |