oculus1
view libovr/Src/osx/OVR_OSX_SensorDevice.cpp @ 23:0c76f70fb7e9
merged
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 28 Sep 2013 04:13:33 +0300 |
parents | |
children |
line source
1 /************************************************************************************
3 Filename : OVR_OSX_SensorDevice.cpp
4 Content : OSX SensorDevice implementation
5 Created : March 14, 2013
6 Authors : Lee Cooper
8 Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved.
10 Use of this software is subject to the terms of the Oculus license
11 agreement provided at the time of installation or download, or which
12 otherwise accompanies this software in either electronic or hard copy form.
14 *************************************************************************************/
16 #include "OVR_OSX_HMDDevice.h"
17 #include "OVR_SensorImpl.h"
18 #include "OVR_DeviceImpl.h"
20 namespace OVR { namespace OSX {
22 } // namespace OSX
24 //-------------------------------------------------------------------------------------
25 void SensorDeviceImpl::EnumerateHMDFromSensorDisplayInfo( const SensorDisplayInfoImpl& displayInfo,
26 DeviceFactory::EnumerateVisitor& visitor)
27 {
29 OSX::HMDDeviceCreateDesc hmdCreateDesc(&OSX::HMDDeviceFactory::Instance, 1, 1, "", 0);
31 hmdCreateDesc.SetScreenParameters( 0, 0,
32 displayInfo.HResolution, displayInfo.VResolution,
33 displayInfo.HScreenSize, displayInfo.VScreenSize);
35 if ((displayInfo.DistortionType & SensorDisplayInfoImpl::Mask_BaseFmt) == SensorDisplayInfoImpl::Base_Distortion)
36 hmdCreateDesc.SetDistortion(displayInfo.DistortionK);
37 if (displayInfo.HScreenSize > 0.14f)
38 hmdCreateDesc.Set7Inch();
40 visitor.Visit(hmdCreateDesc);
41 }
43 } // namespace OVR