-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputClass.h
47 lines (37 loc) · 870 Bytes
/
InputClass.h
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
42
43
44
45
46
47
#pragma once
class InputClass
{
public:
InputClass();
InputClass(const InputClass&);
~InputClass();
bool Initialize(HINSTANCE, HWND, int, int);
void Shutdown();
bool Frame();
bool IsEscapePressed();
bool IsLeftArrowPressed();
bool IsRightArrowPressed();
bool IsUPArrowPressed();
bool IsDownArrowPressed();
bool IsLeftPressed();
bool IsRightPressed();
bool IsUPPressed();
bool IsDownPressed();
bool IsUpZPressed();
bool IsDownZPressed();
void GetMouseLocation(int&, int&);
private:
bool ReadKeyboard();
bool ReadMouse();
void ProcessInput();
private:
IDirectInput8* m_directInput = nullptr;
IDirectInputDevice8* m_keyboard = nullptr;
IDirectInputDevice8* m_mouse = nullptr;
unsigned char m_keyboardState[256] = { 0, };
DIMOUSESTATE m_mouseState;
int m_screenWidth = 0;
int m_screenHeight = 0;
int m_mouseX = 0;
int m_mouseY = 0;
};