]> git.tdb.fi Git - libs/vr.git/blob - source/stereocombiner.h
Give combiners more control over rendering
[libs/vr.git] / source / stereocombiner.h
1 #ifndef MSP_VR_STEREOCOMBINER_H_
2 #define MSP_VR_STEREOCOMBINER_H_
3
4 #include <msp/geometry/angle.h>
5 #include <msp/gl/texture2d.h>
6
7 namespace Msp {
8 namespace VR {
9
10 class StereoCombiner
11 {
12 protected:
13         unsigned target_width;
14         unsigned target_height;
15         float render_aspect;
16         Geometry::Angle<float> fov;
17         float frustum_skew;
18
19         StereoCombiner();
20 public:
21         virtual ~StereoCombiner() { }
22
23         float get_target_width() const { return target_width; }
24         float get_target_height() const { return target_height; }
25         float get_render_aspect() const { return render_aspect; }
26         const Geometry::Angle<float> &get_field_of_view() const { return fov; }
27         float get_frustum_skew() const { return frustum_skew; }
28
29         virtual void prepare() const { }
30         virtual void render(const GL::Texture2D &, const GL::Texture2D &) const = 0;
31 };
32
33 } // namespace VR
34 } // namespace Msp
35
36 #endif