-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputClass.h
More file actions
41 lines (31 loc) · 930 Bytes
/
InputClass.h
File metadata and controls
41 lines (31 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#ifndef INPUTCLASS_H
#define INPUTCLASS_H
#define DIRECTINPUT_VERSION 0x0800
#pragma comment( lib, "dinput8.lib" )
#pragma comment( lib, "dxguid.lib" )
#include <dinput.h>
class InputClass{
public:
InputClass();
~InputClass();
bool Initialize( HINSTANCE, HWND, int ScreenWidth, int ScreenHeight );
bool Frame();
void Shutdown();
bool IsKeyDown( unsigned int Key );
void GetMouseLocation( int& MouseX , int& MouseY );
private:
InputClass( const InputClass& );
bool ReadKeyboard();
bool ReadMouse();
void ProcessInput();
private:
IDirectInput8* m_DirectInput;
IDirectInputDevice8* m_Keyboard;
IDirectInputDevice8* m_Mouse;
unsigned char m_KeyboardState[256];
DIMOUSESTATE m_MouseState;
int m_ScreenWidth, m_ScreenHeight;
int m_MouseX, m_MouseY;
};
#endif