#pragma once #include #include "Core.h" #include "DirectXCore.h" #include #pragma comment(lib, "XInput.lib") enum class ControlInputs { Forward, Back, TurnLeft, TurnRight, StrafeLeft, StrafeRight, Up, Down, Fire1, Fire2 }; class GamePadController { public: GamePadController(); ~GamePadController(); void ProcessGameController(set& currentInputs, bool &boostHit); private: XINPUT_STATE _controllerState; DWORD _lastPacketNumber; bool _firstTime; // These two values are used to avoid having to calculate square roots (which are very time consuming) // when we are checking if the movement of the left or right thumb stick is in the dead zone DWORD _leftThumbDeadZoneSquared; DWORD _rightThumbDeadZoneSquared; };