|
igraphic 0.2.0
Contrats graphiques chargeables : IGraphic2Module / IGraphic3Module
|
Gamepad interface. Not every window can hand one out (a terminal backend has no controller) - IWindow::createGamepad() returns nullptr in that case, this type itself stays complete. More...
#include <IGamepad.hpp>
Public Types | |
| enum | Button { BUTTON_UNKNOWN = -1 , BUTTON_A , BUTTON_B , BUTTON_X , BUTTON_Y , BUTTON_LEFT_BUMPER , BUTTON_RIGHT_BUMPER , BUTTON_BACK , BUTTON_START , BUTTON_LEFT_THUMB , BUTTON_RIGHT_THUMB , BUTTON_DPAD_UP , BUTTON_DPAD_RIGHT , BUTTON_DPAD_DOWN , BUTTON_DPAD_LEFT , BUTTON_LENGTH } |
| enum | Axis { AXIS_LEFT_X , AXIS_LEFT_Y , AXIS_RIGHT_X , AXIS_RIGHT_Y , AXIS_LEFT_TRIGGER , AXIS_RIGHT_TRIGGER , AXIS_LENGTH } |
Public Member Functions | |
| virtual | ~IGamepad ()=default |
| Destroy the IGamepad object. | |
| virtual bool | isAvailable () const =0 |
| notice if a gamepad is actually plugged in | |
| virtual bool | isButtonPressed (Button button) const =0 |
| notice if the button is pressed | |
| virtual bool | isButtonDown (Button button) const =0 |
| notice if the button is down | |
| virtual bool | isButtonReleased (Button button) const =0 |
| notice if the button is released | |
| virtual bool | isButtonUp (Button button) const =0 |
| notice if the button is up | |
| virtual float | getAxisMovement (Axis axis) const =0 |
| the movement of an axis, in [-1, 1] | |
Gamepad interface. Not every window can hand one out (a terminal backend has no controller) - IWindow::createGamepad() returns nullptr in that case, this type itself stays complete.
Same rules as IKeyboard : isButtonPressed / isButtonReleased are true for one frame, isButtonDown / isButtonUp for as long as it lasts, and all four are read anywhere in the frame, as is getAxisMovement().
|
virtualdefault |
Destroy the IGamepad object.
|
pure virtual |
the movement of an axis, in [-1, 1]
| axis |
|
pure virtual |
notice if a gamepad is actually plugged in
|
pure virtual |
notice if the button is down
| button |
|
pure virtual |
notice if the button is pressed
| button |
|
pure virtual |
notice if the button is released
| button |
|
pure virtual |
notice if the button is up
| button |