www.pudn.com > HeightMap_D3D.zip > cInput.h


//----------------------------------------------------------------------------- 
// File: cInput.h 
// Desc: Header file for the DirectInput. All the DI class is declared here. 
//----------------------------------------------------------------------------- 
#ifndef cInput_h 
#define cInput_h 
 
#define DIM_LEFT 0 
#define DIM_RIGHT 1 
#define DIM_MIDDLE 2 
#define DIM_4 3 
#define DIM_5 4 
#define DIM_6 5 
#define DIM_7 6 
#define DIM_8 7 
 
struct CURSOR_VERTEX 
{ 
	int fX, fY; 
}; 
 
class cInput 
{ 
public: 
	cInput(); 
	HRESULT InitDI(); 
	HRESULT InitDIKB(); 
	HRESULT InitDIMouse(); 
 
	HRESULT GetDeviceState(); 
	HRESULT Render(); 
 
	HRESULT BKeyDown(int Key); 
	HRESULT MKeyDown(int Key); 
 
	int getMPosX() { return MPos.fX; }; 
	int getMPosY() { return MPos.fY; }; 
 
	long getM_BuffX() { return M_Buffer.lX; }; 
	long getM_BuffY() { return M_Buffer.lY; }; 
	long getM_BuffZ() { return M_Buffer.lZ; }; 
 
	~cInput(); 
private: 
	LPDIRECTINPUT8 m_lpDI; 
	LPDIRECTINPUTDEVICE8 m_lpDIKB; 
	LPDIRECTINPUTDEVICE8 m_lpDIMouse; 
 
	char chKB_Buffer[256]; 
	DIMOUSESTATE M_Buffer; 
	CURSOR_VERTEX MPos; 
}; 
#endif