nuclear@1: /************************************************************************************ nuclear@1: nuclear@1: Filename : OVR_OSX_SensorDevice.cpp nuclear@1: Content : OSX SensorDevice implementation nuclear@1: Created : March 14, 2013 nuclear@1: Authors : Lee Cooper nuclear@1: nuclear@1: Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. nuclear@1: nuclear@1: Use of this software is subject to the terms of the Oculus license nuclear@1: agreement provided at the time of installation or download, or which nuclear@1: otherwise accompanies this software in either electronic or hard copy form. nuclear@1: nuclear@1: *************************************************************************************/ nuclear@1: nuclear@1: #include "OVR_OSX_HMDDevice.h" nuclear@1: #include "OVR_SensorImpl.h" nuclear@1: #include "OVR_DeviceImpl.h" nuclear@1: nuclear@1: namespace OVR { namespace OSX { nuclear@1: nuclear@1: } // namespace OSX nuclear@1: nuclear@1: //------------------------------------------------------------------------------------- nuclear@1: void SensorDeviceImpl::EnumerateHMDFromSensorDisplayInfo( const SensorDisplayInfoImpl& displayInfo, nuclear@1: DeviceFactory::EnumerateVisitor& visitor) nuclear@1: { nuclear@1: nuclear@1: OSX::HMDDeviceCreateDesc hmdCreateDesc(&OSX::HMDDeviceFactory::Instance, 1, 1, "", 0); nuclear@1: nuclear@1: hmdCreateDesc.SetScreenParameters( 0, 0, nuclear@1: displayInfo.HResolution, displayInfo.VResolution, nuclear@1: displayInfo.HScreenSize, displayInfo.VScreenSize); nuclear@1: nuclear@1: if ((displayInfo.DistortionType & SensorDisplayInfoImpl::Mask_BaseFmt) == SensorDisplayInfoImpl::Base_Distortion) nuclear@1: hmdCreateDesc.SetDistortion(displayInfo.DistortionK); nuclear@1: if (displayInfo.HScreenSize > 0.14f) nuclear@1: hmdCreateDesc.Set7Inch(); nuclear@1: nuclear@1: visitor.Visit(hmdCreateDesc); nuclear@1: } nuclear@1: nuclear@1: } // namespace OVR nuclear@1: nuclear@1: