![]() |
The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
|
The XBox 360 controller class. More...
#include <Controller.h>
Public Member Functions | |
void | GetState () |
Get controller's current state. More... | |
bool | IsConnected () |
Query whether controller is connected. More... | |
void | Vibrate (WORD=0, WORD=0) |
Set left and right rumble. More... | |
const Vector2 | GetRThumb () const |
Get position of right thumb stick. More... | |
const Vector2 | GetLThumb () const |
Get position of left thumb stick. More... | |
const float | GetRTrigger () const |
Get position of right trigger. More... | |
const float | GetLTrigger () const |
Get position of left trigger. More... | |
const bool | GetButtonAToggle () |
Get button A toggle state. More... | |
const bool | GetButtonBToggle () |
Get button B toggle state. More... | |
const bool | GetButtonXToggle () |
Get button X toggle state. More... | |
const bool | GetButtonYToggle () |
Get button Y toggle state. More... | |
const bool | GetDPadRight () const |
Get digital pad right button state. More... | |
const bool | GetDPadLeft () const |
Get digital pad left button state. More... | |
const bool | GetDPadUp () const |
Get digital pad up button state. More... | |
const bool | GetDPadDown () const |
Get digital pad down button state. More... | |
const bool | GetButtonRSToggle () |
Get right shoulder button toggle. More... | |
const bool | GetButtonLSToggle () |
Get left shoulder button toggle. More... | |
Protected Member Functions | |
const bool | ButtonDown (DWORD) const |
Check button state. More... | |
Polled controller class providing access to control states and whether whether buttons have toggled (were up and went down) since the last frame.
|
protected |
button | Index of a button. |
const bool LXBoxController::GetButtonAToggle | ( | ) |
true if button A was toggled.
const bool LXBoxController::GetButtonBToggle | ( | ) |
true if button B was toggled.
const bool LXBoxController::GetButtonLSToggle | ( | ) |
true if left shoulder button was toggled.
const bool LXBoxController::GetButtonRSToggle | ( | ) |
true if right shoulder button was toggled.
const bool LXBoxController::GetButtonXToggle | ( | ) |
true if button X was toggled.
const bool LXBoxController::GetButtonYToggle | ( | ) |
true if button Y was toggled.
const bool LXBoxController::GetDPadDown | ( | ) | const |
const bool LXBoxController::GetDPadLeft | ( | ) | const |
const bool LXBoxController::GetDPadRight | ( | ) | const |
const bool LXBoxController::GetDPadUp | ( | ) | const |
const Vector2 LXBoxController::GetLThumb | ( | ) | const |
const float LXBoxController::GetLTrigger | ( | ) | const |
const Vector2 LXBoxController::GetRThumb | ( | ) | const |
const float LXBoxController::GetRTrigger | ( | ) | const |
void LXBoxController::GetState | ( | ) |
This function should be called once per frame.
bool LXBoxController::IsConnected | ( | ) |
void LXBoxController::Vibrate | ( | WORD | leftVal = 0 , |
WORD | rightVal = 0 |
||
) |
Note: calling this function with no parameters defaults to all stop.
leftVal | Left vibrate speed from zero to max unsigned short. |
rightVal | Right vibrate speed from zero to max unsigned short. |