JNGL
Easy to use cross-platform 2D game library
|
Object representing one Gamepad controller. More...
#include <jngl/Controller.hpp>
Public Member Functions | |
Controller ()=default | |
Use jngl::getConnectedControllers() to query available controllers. | |
Controller (const Controller &)=delete | |
Controller & | operator= (const Controller &)=delete |
Controller (Controller &&)=delete | |
Controller & | operator= (Controller &&)=delete |
float | state (controller::Button) const |
Returns a value between 0.0f (not pressed) and 1.0f (pressed) | |
virtual bool | down (controller::Button) const =0 |
Returns true when the button is down. | |
bool | pressed (controller::Button) |
Returns true only once per frame (until jngl::updateInput is called) for every button press. | |
virtual void | rumble (float, std::chrono::milliseconds) |
0 = no vibration, 1 = maximum | |
Public Member Functions inherited from enable_shared_from_this< Controller > | |
T | enable_shared_from_this (T... args) |
T | operator= (T... args) |
T | shared_from_this (T... args) |
T | weak_from_this (T... args) |
T | ~enable_shared_from_this (T... args) |
Object representing one Gamepad controller.
Definition at line 14 of file Controller.hpp.