|
R-Type 0.1
|
Input query interface filled by the window backend. More...
#include <systems/RenderConcept.hpp>
Public Member Functions | |
| bool | isKeyPressed (Key key) const |
| Tells whether a key is held. | |
| bool | isKeyReleased (Key key) const |
| Tells whether a key was released this frame. | |
| bool | isMouseButtonPressed (MouseButton button) const |
| Tells whether a mouse button is held. | |
| bool | isMouseButtonReleased (MouseButton button) const |
| Tells whether a mouse button was released this frame. | |
| int | getMouseX () const |
| Returns the cursor x position. | |
| int | getMouseY () const |
| Returns the cursor y position. | |
| bool | isGamepadButtonPressed (int joystickId, GamepadButton button) const |
| Tells whether a gamepad button is held. | |
| bool | isGamepadButtonReleased (int joystickId, GamepadButton button) const |
| Tells whether a gamepad button was released this frame. | |
| float | getGamepadAxis (int joystickId, GamepadAxis axis) const |
| Returns the position of a gamepad axis. | |
| bool | isGamepadConnected (int joystickId) const |
| Tells whether a gamepad is plugged in. | |
Public Attributes | |
| void * | userData {nullptr} |
| Backend context passed to every function. | |
| bool(* | _isKeyPressed )(void *, Key) |
| Backend key press query. | |
| bool(* | _isKeyReleased )(void *, Key) |
| Backend key release query. | |
| bool(* | _isMouseButtonPressed )(void *, MouseButton) |
| Backend mouse press query. | |
| bool(* | _isMouseButtonReleased )(void *, MouseButton) |
| Backend mouse release query. | |
| int(* | _getMouseX )(void *) |
| Backend mouse x query. | |
| int(* | _getMouseY )(void *) |
| Backend mouse y query. | |
| bool(* | _isGamepadButtonPressed )(void *, int, GamepadButton) |
| Backend gamepad press query. | |
| bool(* | _isGamepadButtonReleased )(void *, int, GamepadButton) |
| Backend gamepad release query. | |
| float(* | _getGamepadAxis )(void *, int, GamepadAxis) |
| Backend gamepad axis query. | |
| bool(* | _isGamepadConnected )(void *, int) |
| Backend gamepad presence query. | |
Input query interface filled by the window backend.
The backend stores a context pointer and plain function pointers, so the engine can query inputs without depending on the backend types. Every query returns a neutral value when its function pointer is not set.
|
inlinenodiscard |
Tells whether a key is held.
| key | Key to test. |
|
inlinenodiscard |
Tells whether a key was released this frame.
| key | Key to test. |
|
inlinenodiscard |
Tells whether a mouse button is held.
| button | Button to test. |
|
inlinenodiscard |
Tells whether a mouse button was released this frame.
| button | Button to test. |
|
inlinenodiscard |
Returns the cursor x position.
|
inlinenodiscard |
Returns the cursor y position.
|
inlinenodiscard |
Tells whether a gamepad button is held.
| joystickId | Gamepad index. |
| button | Button to test. |
|
inlinenodiscard |
Tells whether a gamepad button was released this frame.
| joystickId | Gamepad index. |
| button | Button to test. |
|
inlinenodiscard |
Returns the position of a gamepad axis.
| joystickId | Gamepad index. |
| axis | Axis to read. |
|
inlinenodiscard |
Tells whether a gamepad is plugged in.
| joystickId | Gamepad index. |