bool directinput::SetCoopLevel(LPDIRECTINPUTDEVICE7 device, HWND window, bool allowBackgroundAccess) { IDirectInputDevice7_Unacquire(device); DWORD flags = DISCL_NONEXCLUSIVE | ((allowBackgroundAccess)? DISCL_BACKGROUND:DISCL_FOREGROUND); return (DI_OK == IDirectInputDevice7_SetCooperativeLevel(device, window, flags)); }
void KeyboardClose(void) { if (lpdid) IDirectInputDevice7_Unacquire(lpdid); lpdid = 0; }
void directinput::DestroyDevice(LPDIRECTINPUTDEVICE7 device) { if(device != NULL) { IDirectInputDevice7_Unacquire(device); IDirectInputDevice7_Release(device); } }