本文整理汇总了C++中LPDIRECTINPUT8::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTINPUT8::Initialize方法的具体用法?C++ LPDIRECTINPUT8::Initialize怎么用?C++ LPDIRECTINPUT8::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTINPUT8
的用法示例。
在下文中一共展示了LPDIRECTINPUT8::Initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DirectInput_Init
int DirectInput_Init(void)
{
HRESULT hr;
if(dInput || dInput3) return true;
// Create the DirectInput interface instance. Try version 8 first.
if(FAILED(hr = CoCreateInstance(CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
IID_IDirectInput8, (LPVOID*)&dInput)) ||
FAILED(hr = dInput->Initialize(app.hInstance, DIRECTINPUT_VERSION)))
{
Con_Message("DirectInput 8 init failed (0x%x).", hr);
// Try the older version 3 interface instead.
// I'm not sure if this works correctly.
if(FAILED(hr = CoCreateInstance(CLSID_DirectInput, NULL, CLSCTX_INPROC_SERVER,
IID_IDirectInput2W, (LPVOID*)&dInput3)) ||
FAILED(hr = dInput3->Initialize(app.hInstance, 0x0300)))
{
Con_Message("Failed to create DirectInput 3 object (0x%x).", hr);
return false;
}
Con_Message("Using DirectInput 3.");
}
if(!dInput && !dInput3)
{
Con_Message(" DirectInput init failed.");
return false;
}
return true;
}
示例2: Initialize
HRESULT _stdcall Initialize(HINSTANCE a,DWORD b)
{
return RealInput->Initialize(a,b);
}