oculus1

diff libovr/Src/win32/OVR_Win32_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/win32/OVR_Win32_SensorDevice.cpp	Sat Sep 14 16:14:59 2013 +0300
     1.3 @@ -0,0 +1,47 @@
     1.4 +/************************************************************************************
     1.5 +
     1.6 +Filename    :   OVR_Win32_SensorDevice.cpp
     1.7 +Content     :   Win32 SensorDevice implementation
     1.8 +Created     :   March 12, 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_Win32_SensorDevice.h"
    1.20 +
    1.21 +#include "OVR_Win32_HMDDevice.h"
    1.22 +#include "OVR_SensorImpl.h"
    1.23 +#include "OVR_DeviceImpl.h"
    1.24 +
    1.25 +namespace OVR { namespace Win32 {
    1.26 +
    1.27 +} // namespace Win32
    1.28 +
    1.29 +//-------------------------------------------------------------------------------------
    1.30 +void SensorDeviceImpl::EnumerateHMDFromSensorDisplayInfo
    1.31 +    (const SensorDisplayInfoImpl& displayInfo, 
    1.32 +     DeviceFactory::EnumerateVisitor& visitor)
    1.33 +{
    1.34 +
    1.35 +    Win32::HMDDeviceCreateDesc hmdCreateDesc(&Win32::HMDDeviceFactory::Instance, String(), String());
    1.36 +    hmdCreateDesc.SetScreenParameters(  0, 0,
    1.37 +                                        displayInfo.HResolution, displayInfo.VResolution,
    1.38 +                                        displayInfo.HScreenSize, displayInfo.VScreenSize);
    1.39 +
    1.40 +    if ((displayInfo.DistortionType & SensorDisplayInfoImpl::Mask_BaseFmt) == SensorDisplayInfoImpl::Base_Distortion)
    1.41 +        hmdCreateDesc.SetDistortion(displayInfo.DistortionK);
    1.42 +    if (displayInfo.HScreenSize > 0.14f)
    1.43 +        hmdCreateDesc.Set7Inch();
    1.44 +
    1.45 +    visitor.Visit(hmdCreateDesc);
    1.46 +}
    1.47 +
    1.48 +} // namespace OVR
    1.49 +
    1.50 +