Files
directx-plane-game/Graphics2/GamePadController.h
iDunnoDev 616f68bf8b Added Comments
Added ability to hold shift and skip the terrain generation when loading
Added ability for the perlin terrain to save a raw image of the terrain to use as a cache
2022-06-13 16:41:25 +01:00

29 lines
841 B
C++

#pragma once
#include <set>
#include "Core.h"
#include "DirectXCore.h"
#include <XInput.h>
#pragma comment(lib, "XInput.lib")
// Emum class for helping with the select of which controller inputs to use
enum class ControlInputs { Forward, Back, TurnLeft, TurnRight, StrafeLeft, StrafeRight, Up, Down, Fire1, Fire2 };
class GamePadController
{
public:
GamePadController();
~GamePadController();
void ProcessGameController(set<ControlInputs>& 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;
};