summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/DirectInput/DirectInput.cpp
blob: 2334db121c8d61f3394eb36a14a68a5ea4c7dae6 (plain)
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
#include "../ControllerInterface.h"

#ifdef CIFACE_USE_DIRECTINPUT

#include "DirectInput.h"

#pragma comment(lib, "Dinput8.lib")
#pragma comment(lib, "dxguid.lib")

namespace ciface
{
namespace DirectInput
{

void Init( std::vector<ControllerInterface::Device*>& devices/*, HWND hwnd*/ )
{
	IDirectInput8* idi8;
	if ( DI_OK != DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID*)&idi8, NULL ) )
		return;

#ifdef CIFACE_USE_DIRECTINPUT_KBM
	InitKeyboardMouse( idi8, devices );
#endif
#ifdef CIFACE_USE_DIRECTINPUT_JOYSTICK
	InitJoystick( idi8, devices/*, hwnd*/ );
#endif

	idi8->Release();

}

}
}

#endif