1 #ifndef MSP_VR_STEREOVIEW_H_
2 #define MSP_VR_STEREOVIEW_H_
4 #include <msp/geometry/angle.h>
5 #include <msp/gl/camera.h>
6 #include <msp/gl/framebuffer.h>
7 #include <msp/gl/renderable.h>
8 #include <msp/gl/renderbuffer.h>
9 #include <msp/gl/texture2d.h>
14 class HeadTrackingCamera;
24 GL::Renderbuffer depth;
26 RenderTarget(unsigned, unsigned);
31 Geometry::Angle<float> fov;
39 mutable GL::Camera camera;
40 GL::Matrix offset_matrix;
45 void create_target(unsigned, unsigned);
46 void setup_frame(const GL::Camera &, float, const EyeParams &) const;
47 void render(const GL::Renderable &) const;
50 const StereoCombiner &combiner;
51 const GL::Camera &base_camera;
52 HeadTrackingCamera *head_camera;
53 const GL::Renderable *content;
56 Geometry::Angle<float> strabismus;
59 StereoView(const StereoCombiner &, const GL::Camera &);
60 StereoView(const StereoCombiner &, HeadTrackingCamera &);
65 void set_content(const GL::Renderable *);
66 void set_eye_spacing(float);
67 void set_eye_matrices(const GL::Matrix &, const GL::Matrix &);
68 void set_strabismus(const Geometry::Angle<float> &);
71 void setup_frame() const;