oculus1

annotate libovr/Src/osx/OVR_OSX_SensorDevice.cpp @ 29:9a973ef0e2a3

fixed the performance issue under MacOSX by replacing glutSolidTeapot (which uses glEvalMesh) with my own teapot generator.
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 27 Oct 2013 06:31:18 +0200
parents
children
rev   line source
nuclear@1 1 /************************************************************************************
nuclear@1 2
nuclear@1 3 Filename : OVR_OSX_SensorDevice.cpp
nuclear@1 4 Content : OSX SensorDevice implementation
nuclear@1 5 Created : March 14, 2013
nuclear@1 6 Authors : Lee Cooper
nuclear@1 7
nuclear@1 8 Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved.
nuclear@1 9
nuclear@1 10 Use of this software is subject to the terms of the Oculus license
nuclear@1 11 agreement provided at the time of installation or download, or which
nuclear@1 12 otherwise accompanies this software in either electronic or hard copy form.
nuclear@1 13
nuclear@1 14 *************************************************************************************/
nuclear@1 15
nuclear@1 16 #include "OVR_OSX_HMDDevice.h"
nuclear@1 17 #include "OVR_SensorImpl.h"
nuclear@1 18 #include "OVR_DeviceImpl.h"
nuclear@1 19
nuclear@1 20 namespace OVR { namespace OSX {
nuclear@1 21
nuclear@1 22 } // namespace OSX
nuclear@1 23
nuclear@1 24 //-------------------------------------------------------------------------------------
nuclear@1 25 void SensorDeviceImpl::EnumerateHMDFromSensorDisplayInfo( const SensorDisplayInfoImpl& displayInfo,
nuclear@1 26 DeviceFactory::EnumerateVisitor& visitor)
nuclear@1 27 {
nuclear@1 28
nuclear@1 29 OSX::HMDDeviceCreateDesc hmdCreateDesc(&OSX::HMDDeviceFactory::Instance, 1, 1, "", 0);
nuclear@1 30
nuclear@1 31 hmdCreateDesc.SetScreenParameters( 0, 0,
nuclear@1 32 displayInfo.HResolution, displayInfo.VResolution,
nuclear@1 33 displayInfo.HScreenSize, displayInfo.VScreenSize);
nuclear@1 34
nuclear@1 35 if ((displayInfo.DistortionType & SensorDisplayInfoImpl::Mask_BaseFmt) == SensorDisplayInfoImpl::Base_Distortion)
nuclear@1 36 hmdCreateDesc.SetDistortion(displayInfo.DistortionK);
nuclear@1 37 if (displayInfo.HScreenSize > 0.14f)
nuclear@1 38 hmdCreateDesc.Set7Inch();
nuclear@1 39
nuclear@1 40 visitor.Visit(hmdCreateDesc);
nuclear@1 41 }
nuclear@1 42
nuclear@1 43 } // namespace OVR
nuclear@1 44
nuclear@1 45