VRPlatformDisplayOpenVR.h [plain text]
#pragma once
#if USE(OPENVR)
#include "VRPlatformDisplay.h"
#include <openvr.h>
namespace WebCore {
class VRPlatformDisplayOpenVR : public VRPlatformDisplay {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit VRPlatformDisplayOpenVR(vr::IVRSystem*, vr::IVRChaperone*, vr::IVRCompositor*);
~VRPlatformDisplayOpenVR() = default;
VRPlatformDisplayInfo getDisplayInfo() override { return m_displayInfo; }
VRPlatformTrackingInfo getTrackingInfo() override;
void updateDisplayInfo() override;
private:
VRPlatformDisplayInfo::FieldOfView computeFieldOfView(vr::Hmd_Eye);
void updateEyeParameters();
void updateStageParameters();
static uint32_t s_displayIdentifier;
vr::IVRSystem* m_system;
vr::IVRChaperone* m_chaperone;
vr::IVRCompositor* m_compositor;
VRPlatformDisplayInfo m_displayInfo;
VRPlatformTrackingInfo m_trackingInfo;
};
};
#endif // USE(OPENVR)