public:
virtual ~DisplayDevice() { }
+ virtual void configure_window(Graphics::Window &) const = 0;
virtual void configure_view(StereoView &) const = 0;
virtual HeadTrackingCamera *create_camera(const GL::Camera &) = 0;
virtual StereoCombiner *create_combiner(GL::View &) = 0;
ovrHmd_GetRenderScaleAndOffset(right_fov, tex_size, view_rect, uv_scale_offset);
right_shdata.uniform("uv_scale", uv_scale_offset[0].x, -uv_scale_offset[0].y);
right_shdata.uniform("uv_offset", uv_scale_offset[1].x, 1-uv_scale_offset[1].y);
+
+ device.configure_window(view.get_window());
}
void OculusRiftCombiner::prepare() const
+#include <msp/graphics/display.h>
#include <msp/vr/stereoview.h>
#include "oculusriftdevice.h"
#include "oculusriftdevice_private.h"
ovr_Shutdown();
}
+void OculusRiftDevice::configure_window(Graphics::Window &window) const
+{
+ Graphics::WindowOptions win_opts = window.get_options();
+ win_opts.width = priv->ovr_hmd->Resolution.w;
+ win_opts.height = priv->ovr_hmd->Resolution.h;
+
+ const list<Graphics::Monitor> &monitors = window.get_display().get_monitors();
+ string hmd_name = priv->ovr_hmd->ProductName;
+ for(list<Graphics::Monitor>::const_iterator i=monitors.begin(); i!=monitors.end(); ++i)
+ if(hmd_name.find(i->name)!=string::npos)
+ {
+ win_opts.fullscreen = true;
+ win_opts.fullscreen_monitor = &*i;
+ win_opts.fullscreen_exclusive = false;
+ }
+
+ window.reconfigure(win_opts);
+}
+
void OculusRiftDevice::configure_view(StereoView &view) const
{
ovrEyeRenderDesc left_desc = ovrHmd_GetRenderDesc(priv->ovr_hmd, ovrEye_Left, priv->ovr_hmd->DefaultEyeFov[ovrEye_Left]);
const Private &get_private() const { return *priv; }
+ virtual void configure_window(Graphics::Window &) const;
virtual void configure_view(StereoView &) const;
virtual OculusRiftCamera *create_camera(const GL::Camera &);
virtual OculusRiftCombiner *create_combiner(GL::View &);