diff options
author | Brad Davis <[email protected]> | 2014-04-14 21:25:09 -0700 |
---|---|---|
committer | Brad Davis <[email protected]> | 2014-04-14 21:25:09 -0700 |
commit | 07d0f4d0bbf3477ac6a9584f726e8ec6ab285707 (patch) | |
tree | 1854d0c690eff32e77b137567c88a52d56d8b660 /LibOVR/Src/OVR_Win32_HIDDevice.cpp | |
parent | f28388ff2af14b56ef2d973b2f4f9da021716d4c (diff) |
Adding windows 0.3.1 SDK
Diffstat (limited to 'LibOVR/Src/OVR_Win32_HIDDevice.cpp')
-rw-r--r-- | LibOVR/Src/OVR_Win32_HIDDevice.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/LibOVR/Src/OVR_Win32_HIDDevice.cpp b/LibOVR/Src/OVR_Win32_HIDDevice.cpp index 8643041..6d33f7a 100644 --- a/LibOVR/Src/OVR_Win32_HIDDevice.cpp +++ b/LibOVR/Src/OVR_Win32_HIDDevice.cpp @@ -5,16 +5,16 @@ Content : Win32 HID device implementation. Created : February 22, 2013 Authors : Lee Cooper -Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. +Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved. -Licensed under the Oculus VR SDK License Version 2.0 (the "License"); -you may not use the Oculus VR SDK except in compliance with the License, +Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License"); +you may not use the Oculus VR Rift SDK except in compliance with the License, which is provided at the time of installation or download, or which otherwise accompanies this software in either electronic or hard copy form. You may obtain a copy of the License at -http://www.oculusvr.com/licenses/LICENSE-2.0 +http://www.oculusvr.com/licenses/LICENSE-3.1 Unless required by applicable law or agreed to in writing, the Oculus VR SDK distributed under the License is distributed on an "AS IS" BASIS, @@ -168,10 +168,10 @@ bool HIDDeviceManager::GetHIDDeviceDesc(const String& path, HIDDeviceDesc* pdevD return false; pdevDesc->Path = path; - getFullDesc(hidDev, pdevDesc); + bool succ = getFullDesc(hidDev, pdevDesc); ::CloseHandle(hidDev); - return true; + return succ; } OVR::HIDDevice* HIDDeviceManager::Open(const String& path) @@ -298,10 +298,11 @@ bool HIDDevice::HIDInitialize(const String& path) HIDManager->Manager->pThread->AddMessageNotifier(this); LogText("OVR::Win32::HIDDevice - Opened '%s'\n" - " Manufacturer:'%s' Product:'%s' Serial#:'%s'\n", + " Manufacturer:'%s' Product:'%s' Serial#:'%s' Version:'%x'\n", DevDesc.Path.ToCStr(), DevDesc.Manufacturer.ToCStr(), DevDesc.Product.ToCStr(), - DevDesc.SerialNumber.ToCStr()); + DevDesc.SerialNumber.ToCStr(), + DevDesc.VersionNumber); return true; } @@ -500,18 +501,20 @@ void HIDDevice::closeDeviceOnIOError() bool HIDDevice::SetFeatureReport(UByte* data, UInt32 length) { - if (!ReadRequested) + if (!ReadRequested) return false; - return HIDManager->HidD_SetFeature(Device, data, (ULONG) length) != FALSE; + BOOLEAN res = HIDManager->HidD_SetFeature(Device, data, (ULONG) length); + return (res == TRUE); } bool HIDDevice::GetFeatureReport(UByte* data, UInt32 length) { - if (!ReadRequested) + if (!ReadRequested) return false; - return HIDManager->HidD_GetFeature(Device, data, (ULONG) length) != FALSE; + BOOLEAN res = HIDManager->HidD_GetFeature(Device, data, (ULONG) length); + return (res == TRUE); } void HIDDevice::OnOverlappedEvent(HANDLE hevent) @@ -526,14 +529,14 @@ void HIDDevice::OnOverlappedEvent(HANDLE hevent) } } -UInt64 HIDDevice::OnTicks(UInt64 ticksMks) +double HIDDevice::OnTicks(double tickSeconds) { if (Handler) { - return Handler->OnTicks(ticksMks); + return Handler->OnTicks(tickSeconds); } - return DeviceManagerThread::Notifier::OnTicks(ticksMks); + return DeviceManagerThread::Notifier::OnTicks(tickSeconds); } bool HIDDevice::OnDeviceMessage(DeviceMessageType messageType, |