poll DInput for number of joysticks instead of polling registry for num HID devices. Fixes us resetting INPUTMAN too early (after Windows sees the HID device but before DirectInput exposes it)

This commit is contained in:
Chris Danford
2006-02-09 00:53:20 +00:00
parent ecce21a0b4
commit a1fcc64baf
4 changed files with 30 additions and 20 deletions
@@ -10,7 +10,7 @@
#pragma comment(lib, "dxguid.lib")
#endif
#endif
LPDIRECTINPUT dinput = NULL;
LPDIRECTINPUT g_dinput = NULL;
static int ConvertScancodeToKey( int scancode );
static BOOL CALLBACK DIJoystick_EnumDevObjectsProc(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID data);
@@ -30,7 +30,7 @@ bool DIDevice::Open()
buffered = true;
LPDIRECTINPUTDEVICE tmpdevice;
HRESULT hr = dinput->CreateDevice( JoystickInst.guidInstance, &tmpdevice, NULL );
HRESULT hr = g_dinput->CreateDevice( JoystickInst.guidInstance, &tmpdevice, NULL );
if ( hr != DI_OK )
{
LOG->Info( hr_ssprintf(hr, "OpenDevice: IDirectInput_CreateDevice") );