Files
WickedEngine/WickedEngine/wiXInput.h
turanszkij a49eecbd9d updated voxelizer with conservative rasterization;
dropped windows 7 support;
other updates;
2017-02-27 23:56:58 +01:00

36 lines
712 B
C++

#pragma once
#include "CommonInclude.h"
#include <Xinput.h>
#pragma comment(lib,"xinput.lib")
#define MAX_CONTROLLERS 4 // XInput handles up to 4 controllers
#define INPUT_DEADZONE ( 0.24f * FLOAT(0x7FFF) ) // Default to 24% of the +/- 32767 range. This is a reasonable default value but can be altered if needed.
class wiXInput
{
private:
struct CONTROLLER_STATE
{
XINPUT_STATE state;
bool bConnected;
};
public:
wiXInput();
~wiXInput();
HRESULT UpdateControllerState();
DWORD GetButtons(SHORT);
DWORD GetDirections(short);
bool isButtonDown(short,DWORD);
void CleanUp();
CONTROLLER_STATE controllers[MAX_CONTROLLERS];
WCHAR g_szMessage[4][1024];
bool g_bDeadZoneOn;
};