DIE Engine
Loading...
Searching...
No Matches
Gamepad Class Reference

#include <gamepad.h>

Public Member Functions

 Gamepad (int id)
void update ()
 Poll the controller state (axes, buttons, presence).
void feedback (float left, float right)
 Set the vibration motor speeds.

Public Attributes

int id
float leftX
float leftY
float rightX
float rightY
uint32_t buttons
uint32_t toggled
uint32_t pressed
uint32_t released
bool detected

Constructor & Destructor Documentation

◆ Gamepad()

Gamepad::Gamepad ( int id)

Member Function Documentation

◆ feedback()

void Gamepad::feedback ( float left,
float right )

Set the vibration motor speeds.

Parameters
leftlow-frequency motor strength (0.0 .. 1.0)
righthigh-frequency motor strength (0.0 .. 1.0)

◆ update()

void Gamepad::update ( )

Poll the controller state (axes, buttons, presence).

Member Data Documentation

◆ buttons

uint32_t Gamepad::buttons

◆ detected

bool Gamepad::detected

◆ id

int Gamepad::id

◆ leftX

float Gamepad::leftX

◆ leftY

float Gamepad::leftY

◆ pressed

uint32_t Gamepad::pressed

◆ released

uint32_t Gamepad::released

◆ rightX

float Gamepad::rightX

◆ rightY

float Gamepad::rightY

◆ toggled

uint32_t Gamepad::toggled

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