![]() |
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... | |
Protected Attributes | |
| XINPUT_STATE | m_strState |
| Controller's current state (polled each frame). | |
| bool | m_bButtonADown = false |
| A button is down. | |
| bool | m_bButtonBDown = false |
| B button is down. | |
| bool | m_bButtonXDown = false |
| X button is down. | |
| bool | m_bButtonYDown = false |
| Y button is down. | |
| bool | m_bButtonLSDown = false |
| Left shoulder button is down. | |
| bool | m_bButtonRSDown = false |
| Right shoulder button is down. | |
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 CXBoxController::GetButtonAToggle | ( | ) |
true if button A was toggled.
| const bool CXBoxController::GetButtonBToggle | ( | ) |
true if button B was toggled.
| const bool CXBoxController::GetButtonLSToggle | ( | ) |
true if left shoulder button was toggled.
| const bool CXBoxController::GetButtonRSToggle | ( | ) |
true if right shoulder button was toggled.
| const bool CXBoxController::GetButtonXToggle | ( | ) |
true if button X was toggled.
| const bool CXBoxController::GetButtonYToggle | ( | ) |
true if button Y was toggled.
| const bool CXBoxController::GetDPadDown | ( | ) | const |
| const bool CXBoxController::GetDPadLeft | ( | ) | const |
| const bool CXBoxController::GetDPadRight | ( | ) | const |
| const bool CXBoxController::GetDPadUp | ( | ) | const |
| const Vector2 CXBoxController::GetLThumb | ( | ) | const |
| const float CXBoxController::GetLTrigger | ( | ) | const |
| const Vector2 CXBoxController::GetRThumb | ( | ) | const |
| const float CXBoxController::GetRTrigger | ( | ) | const |
| void CXBoxController::GetState | ( | ) |
This function should be called once per frame.
| bool CXBoxController::IsConnected | ( | ) |
| void CXBoxController::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. |
1.8.14