|
Rendu
A lightweight rendering engine for experimentations
|
Represents a controller with a predefined mapping provided by GLFW/SDL. More...
#include <GamepadController.hpp>
Public Member Functions | |
| bool | activate (int id) override |
| void | deactivate () override |
| void | update () override |
Public Member Functions inherited from Controller | |
| Controller () | |
| Constructor. | |
| virtual bool | activate (int id)=0 |
| virtual void | deactivate ()=0 |
| virtual void | update ()=0 |
| bool | pressed (const Controller::Input &input) const |
| bool | triggered (const Controller::Input &input, bool absorb=false) |
| float | axis (const Controller::Input &input) const |
| int | id () const |
| std::string | name () const |
| std::string | guid () const |
| virtual | ~Controller ()=default |
| Destructor. | |
| Controller (const Controller &)=delete | |
| Controller & | operator= (const Controller &)=delete |
| Controller (Controller &&)=delete | |
| Controller & | operator= (Controller &&)=delete |
Additional Inherited Members | |
Public Types inherited from Controller | |
| enum | Input { ButtonX , ButtonY , ButtonA , ButtonB , BumperL1 , TriggerL2 , ButtonL3 , BumperR1 , TriggerR2 , ButtonR3 , ButtonUp , ButtonLeft , ButtonDown , ButtonRight , ButtonLogo , ButtonMenu , ButtonView , PadLeftX , PadLeftY , PadRightX , PadRightY , InputCount } |
| Controller inputs, based on the Xbox controller layout. | |
Static Public Member Functions inherited from Controller | |
| static void | saveConfiguration (const std::string &outputPath, const std::string &guid, const std::string &name, const std::vector< int > &axesMapping, const std::vector< int > &buttonsMapping) |
| static bool | parseConfiguration (const std::string &settingsContent, std::vector< int > &axesMapping, std::vector< int > &buttonsMapping) |
Protected Member Functions inherited from Controller | |
| void | reset () |
Protected Attributes inherited from Controller | |
| ControllerButton | _buttons [Controller::Input::InputCount] |
| States of all possible buttons. | |
| float | _axes [Controller::Input::InputCount] |
| States of all possible axis. | |
| int | _id = -1 |
| Joystick ID (or -1 if no joystick is connected). | |
| std::string | _name = "Unknown" |
| Name of the joystick. | |
| std::string | _guid = "0x0" |
| GUID of the joystick. | |
Represents a controller with a predefined mapping provided by GLFW/SDL.
Inherits Controller.
|
overridevirtual |
Enable the controller.
| id | the ID of the controller. |
Implements Controller.
|
overridevirtual |
Disable the controller.
Implements Controller.
|
overridevirtual |
Update the internal controller state (once per frame).
Implements Controller.