1 // InputTask.cpp: implementation of the CInputTask class.
\r
3 //////////////////////////////////////////////////////////////////////
\r
5 #include "InputTask.h"
\r
9 // include the DirectX Library files
\r
10 #pragma comment (lib, "dinput.lib")
\r
11 #pragma comment (lib, "dinput8.lib")
\r
12 #pragma comment (lib, "dxguid.lib")
\r
16 //////////////////////////////////////////////////////////////////////
\r
17 // Construction/Destruction
\r
18 //////////////////////////////////////////////////////////////////////
\r
20 //unsigned char *CInputTask::keys=0;
\r
21 //CMMPointer<CMMDynamicBlob<unsigned char> > CInputTask::oldKeys=0;
\r
22 int CInputTask::keyCount=0;
\r
23 BYTE *CInputTask::keys;
\r
24 BYTE *CInputTask::oldKeys;
\r
25 int CInputTask::dX=0;
\r
26 int CInputTask::dY=0;
\r
27 unsigned int CInputTask::buttons=0;
\r
28 unsigned int CInputTask::oldButtons=0;
\r
30 CInputTask::CInputTask(CKernel* kernel) : ITask(kernel)
\r
36 CInputTask::~CInputTask()
\r
40 bool CInputTask::Start()
\r
42 keys=SDL_GetKeyState(&keyCount);
\r
43 oldKeys=new BYTE[keyCount];
\r
45 SDL_PumpEvents(); SDL_PumpEvents();
\r
49 void CInputTask::Update()
\r
53 buttons=SDL_GetRelativeMouseState(&dX,&dY);
\r
54 memcpy((unsigned char*)(*oldKeys),keys,sizeof(unsigned char)*keyCount);
\r
55 keys=SDL_GetKeyState(&keyCount);
\r
58 void CInputTask::Stop()
\r