oculus1
diff libovr/Src/osx/OVR_OSX_SensorDevice.cpp @ 1:e2f9e4603129
added LibOVR and started a simple vr wrapper.
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 14 Sep 2013 16:14:59 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libovr/Src/osx/OVR_OSX_SensorDevice.cpp Sat Sep 14 16:14:59 2013 +0300 1.3 @@ -0,0 +1,45 @@ 1.4 +/************************************************************************************ 1.5 + 1.6 +Filename : OVR_OSX_SensorDevice.cpp 1.7 +Content : OSX SensorDevice implementation 1.8 +Created : March 14, 2013 1.9 +Authors : Lee Cooper 1.10 + 1.11 +Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. 1.12 + 1.13 +Use of this software is subject to the terms of the Oculus license 1.14 +agreement provided at the time of installation or download, or which 1.15 +otherwise accompanies this software in either electronic or hard copy form. 1.16 + 1.17 +*************************************************************************************/ 1.18 + 1.19 +#include "OVR_OSX_HMDDevice.h" 1.20 +#include "OVR_SensorImpl.h" 1.21 +#include "OVR_DeviceImpl.h" 1.22 + 1.23 +namespace OVR { namespace OSX { 1.24 + 1.25 +} // namespace OSX 1.26 + 1.27 +//------------------------------------------------------------------------------------- 1.28 +void SensorDeviceImpl::EnumerateHMDFromSensorDisplayInfo( const SensorDisplayInfoImpl& displayInfo, 1.29 + DeviceFactory::EnumerateVisitor& visitor) 1.30 +{ 1.31 + 1.32 + OSX::HMDDeviceCreateDesc hmdCreateDesc(&OSX::HMDDeviceFactory::Instance, 1, 1, "", 0); 1.33 + 1.34 + hmdCreateDesc.SetScreenParameters( 0, 0, 1.35 + displayInfo.HResolution, displayInfo.VResolution, 1.36 + displayInfo.HScreenSize, displayInfo.VScreenSize); 1.37 + 1.38 + if ((displayInfo.DistortionType & SensorDisplayInfoImpl::Mask_BaseFmt) == SensorDisplayInfoImpl::Base_Distortion) 1.39 + hmdCreateDesc.SetDistortion(displayInfo.DistortionK); 1.40 + if (displayInfo.HScreenSize > 0.14f) 1.41 + hmdCreateDesc.Set7Inch(); 1.42 + 1.43 + visitor.Visit(hmdCreateDesc); 1.44 +} 1.45 + 1.46 +} // namespace OVR 1.47 + 1.48 +