The game controller device interface.
More...
#include <murl_i_game_controller.h>
The game controller device interface.
Used by the platform to post events to the device.
Inherited by Murl::Input::GameControllerDevice.
◆ SetConnected()
virtual void Murl::IGameController::SetConnected |
( |
Bool |
isConnected | ) |
|
|
pure virtual |
Set the connected state.
Once a controller is created, it is not allowed to destroy the controller instance when a controller is disconnected. Only the connected state changes. If another controller is connected, the controller instance will be reconfigured.
- Parameters
-
isConnected | The connected state. |
◆ SetPlayerIndex()
virtual void Murl::IGameController::SetPlayerIndex |
( |
SInt32 |
playerIndex | ) |
|
|
pure virtual |
Set the player index.
The player number is typically indicated by lights on the controller, a negative index value indicates an unset state (no lights are lit on the controller).
- Parameters
-
playerIndex | The zero-based index of the player. |
◆ SetDeviceInfo()
Set the device information.
- Parameters
-
deviceInfo | The device information. |
◆ SetAvailableControls()
virtual void Murl::IGameController::SetAvailableControls |
( |
const ButtonArray & |
buttons, |
|
|
const ControlArray & |
controls |
|
) |
| |
|
pure virtual |
Set the available controls.
Automatically sets the d-pad control to available if any d-pad button is set.
- Parameters
-
buttons | An array of avaliable game controller buttons. |
controls | An array of available game controller controls. |
◆ PostAxisEvent()
Post the current game controller axis value.
- Parameters
-
axisEvent | The axis event, see enum IGameControllerMapping::AxisEvents. |
value | The corresponding event value. |
◆ PostButtonEvent()
Post the current game controller button state.
- Parameters
-
button | The button identifier. |
pressed | true if the button is pressed. |
◆ PostGravityEvent()
virtual void Murl::IGameController::PostGravityEvent |
( |
Float |
gravX, |
|
|
Float |
gravY, |
|
|
Float |
gravZ |
|
) |
| |
|
pure virtual |
Post the current game controller gravity values.
- Parameters
-
gravX | The x-axis gravity in meter per seconds^2. |
gravY | The y-axis gravity in meter per seconds^2. |
gravZ | The z-axis gravity in meter per seconds^2. |
◆ PostAccelerationEvent()
virtual void Murl::IGameController::PostAccelerationEvent |
( |
Float |
accelX, |
|
|
Float |
accelY, |
|
|
Float |
accelZ |
|
) |
| |
|
pure virtual |
Post the current game controller acceleration values.
- Parameters
-
accelX | The x-axis acceleration in meter per seconds^2. |
accelY | The y-axis acceleration in meter per seconds^2. |
accelZ | The z-axis acceleration in meter per seconds^2. |
◆ TakeTouchOrientationEnabled()
virtual Bool Murl::IGameController::TakeTouchOrientationEnabled |
( |
Bool & |
isEnabled | ) |
|
|
pure virtual |
Take the touchpad orientation enabled state.
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_TOUCH_ORIENTATION.
- Parameters
-
isEnabled | The touchpad orientation enabled state return value. |
- Returns
- true if the control is available and the state was modified, if false the 'isEnabled' return value stays unchanged.
◆ TakeTouchAbsoluteEnabled()
virtual Bool Murl::IGameController::TakeTouchAbsoluteEnabled |
( |
Bool & |
isEnabled | ) |
|
|
pure virtual |
Take the touchpad absolute enabled state.
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_TOUCH_ABS_REL.
- Parameters
-
isEnabled | The touchpad absolute enabled state return value. |
- Returns
- true if the control is available and the state was modified, if false the 'isEnabled' return value stays unchanged.
◆ TakeVibration()
Take the current vibration.
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_VIBRATE_LOW or IEnums::GAME_CONTROLLER_CONTROL_VIBRATE_HIGH.
Automatically sets the used vibration control to available.
- Parameters
-
intensity | The intensity of the vibration return value in range [0.0 none .. 1.0 full]. |
control | The game controller control identifier. |
- Returns
- true if the control is available and the intensity was modified, if false the 'intensity' return value stays unchanged.
◆ CreateMapping()
Create the game controller mapping interface.
Gamecontroller mapping is supported by USB HID game controller devices only, e.g. XBox controller or iOS controller do not create a mapping.
- Returns
- The game controller mapping interface.
The documentation for this interface was generated from the following file: