Plasma Engine  2.0
Loading...
Searching...
No Matches
InputDeviceXBox.h
1#pragma once
2
3#include <Core/Input/DeviceTypes/Controller.h>
4#include <XBoxControllerPlugin/XBoxControllerDLL.h>
5
9class PL_XBOXCONTROLLER_DLL plInputDeviceXBox360 : public plInputDeviceController
10{
11 PL_ADD_DYNAMIC_REFLECTION(plInputDeviceXBox360, plInputDeviceController);
12
13public:
16
18 static plInputDeviceXBox360* GetDevice();
19
21 static void DestroyAllDevices();
22
23 virtual bool IsControllerConnected(plUInt8 uiPhysical) const override;
24
25private:
26 virtual void ApplyVibration(plUInt8 uiPhysicalController, Motor::Enum eMotor, float fStrength) override;
27
28 bool m_bControllerConnected[4];
29
30 virtual void InitializeDevice() override {}
31 virtual void UpdateInputSlotValues() override;
32 virtual void RegisterInputSlots() override;
33 virtual void UpdateHardwareState(plTime tTimeDifference) override;
34
35 void SetValue(plInt32 iController, const char* szButton, float fValue);
36
37 static void RegisterControllerButton(const char* szButton, const char* szName, plBitflags<plInputSlotFlags> SlotFlags);
38 static void SetDeadZone(const char* szButton);
39};
This class is the base class for all controller type input devices.
Definition Controller.h:12
virtual bool IsControllerConnected(plUInt8 uiPhysical) const =0
Queries whether the controller with the given physical index is connected to the computer....
virtual void ApplyVibration(plUInt8 uiPhysicalController, Motor::Enum eMotor, float fStrength)=0
Must be implemented by a derived controller implementation. Should set apply the vibration for the gi...
virtual void UpdateHardwareState(plTime tTimeDifference)
This function is called once after plInputManager::Update with the same time delta value....
Definition InputDevice.h:128
virtual void UpdateInputSlotValues()=0
Override this, if you need to query the state of the hardware to update the input slots.
virtual void RegisterInputSlots()=0
Override this to register all the input slots that this device exposes.
An implementation of plInputDeviceController that handles XBox 360 controllers.
Definition InputDeviceXBox.h:10
virtual void InitializeDevice() override
Override this if you need to do device specific initialization before the first use.
Definition InputDeviceXBox.h:30
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12