class HeadTrackingCamera;
class StereoCombiner;
+class StereoView;
class DisplayDevice
{
public:
virtual ~DisplayDevice() { }
+ virtual void configure_view(StereoView &) const = 0;
virtual HeadTrackingCamera *create_camera(const GL::Camera &) const = 0;
virtual StereoCombiner *create_combiner() const = 0;
};
#include "oculusriftdevice.h"
#include "oculusriftdevice_private.h"
+#include "stereoview.h"
using namespace std;
ovr_Shutdown();
}
+void OculusRiftDevice::configure_view(StereoView &view) const
+{
+ ovrEyeRenderDesc left_desc = ovrHmd_GetRenderDesc(priv->ovr_hmd, ovrEye_Left, priv->ovr_hmd->DefaultEyeFov[ovrEye_Left]);
+ ovrEyeRenderDesc right_desc = ovrHmd_GetRenderDesc(priv->ovr_hmd, ovrEye_Right, priv->ovr_hmd->DefaultEyeFov[ovrEye_Left]);
+ view.set_eye_spacing(left_desc.HmdToEyeViewOffset.x-right_desc.HmdToEyeViewOffset.x);
+}
+
OculusRiftCamera *OculusRiftDevice::create_camera(const GL::Camera &bc) const
{
return new OculusRiftCamera(*this, bc);
const Private &get_private() const { return *priv; }
+ virtual void configure_view(StereoView &) const;
virtual OculusRiftCamera *create_camera(const GL::Camera &) const;
virtual OculusRiftCombiner *create_combiner() const;
};