JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Controller Class Referenceabstract

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
 
Controlleroperator= (const Controller &)=delete
 
 Controller (Controller &&)=delete
 
Controlleroperator= (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)
 

Detailed Description

Object representing one Gamepad controller.

Definition at line 14 of file Controller.hpp.

Inheritance diagram for Controller:
[legend]
Collaboration diagram for Controller:
[legend]

The documentation for this class was generated from the following file: