forked from abartlett139/Omni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Input.h
68 lines (61 loc) · 1.58 KB
/
Input.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#ifndef INPUT_H_
#define INPUT_H_
#include <d3d9.h>
#include <d3dx9.h>
#include <dinput.h>
#include "UIWrappers.h"
#include <vector>
class Keyboard;
class Mouse;
class Input
{
private:
LPDIRECTINPUT8 m_pInput;
HWND m_hWnd;
public:
Input(HINSTANCE hinst,HWND hWnd);
Keyboard* CreateKeyboard();
Mouse* CreateMouse(LPDIRECT3DDEVICE9 pDevice, bool Exclusive);
~Input();
};
///-------------------------------------------------------------Keyboard------------------------------------------------------------
class Keyboard
{
private:
LPDIRECTINPUTDEVICE8 m_pInputDevice;
char m_KeyState[256];
public:
Keyboard(LPDIRECTINPUT8 pInput, HWND hWnd);
~Keyboard();
bool IsKeyPressed(int Key);
HRESULT Update();
};
///----------------------------------------------------------Mouse-------------------------------------------------------------------
class Mouse
{
RECT pos[8];
//Surface* m_Surf;
IDirect3DSurface9* m_Cursor;
LPDIRECTINPUTDEVICE8 m_pInputDevice;
LPDIRECT3DDEVICE9 Device;
DIMOUSESTATE m_State;
LONG m_iX;
LONG m_iY;
bool m_Changed;
bool m_Buttons;
int m_Type;
public:
Mouse( LPDIRECT3DDEVICE9 pDevice, LPDIRECTINPUT8 pInput, HWND hWnd,
bool Exclusive/*, D3DDISPLAYMODE Mode */);
~Mouse( );
HRESULT Update( );
LONG GetXPos( );
LONG GetYPos( );
bool IsButtonPressed( int Button );
HRESULT SetMouseCursor( char* FilePath,UINT x, UINT y,int Type );
void SetCursorImage( int Type );
void SetCursorPosition( int x, int y );
HRESULT SetCursorVisible( bool Show );
};
#endif