]> git.tdb.fi Git - libs/vr.git/blob - source/stereocombiner.h
23d482267e0ad706a1575a70657d4dbd1725d7da
[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 width_div;
14         unsigned height_div;
15         bool keep_aspect;
16         Geometry::Angle<float> fov;
17         float oversize;
18         float frustum_skew;
19
20         StereoCombiner();
21 public:
22         virtual ~StereoCombiner() { }
23
24         unsigned get_width_divisor() const { return width_div; }
25         unsigned get_height_divisor() const { return height_div; }
26         bool is_aspect_kept() const { return keep_aspect; }
27         const Geometry::Angle<float> &get_field_of_view() const { return fov; }
28         float get_oversize() const { return oversize; }
29         float get_frustum_skew() const { return frustum_skew; }
30
31         virtual void render(const GL::Texture2D &, const GL::Texture2D &) const = 0;
32 };
33
34 } // namespace VR
35 } // namespace Msp
36
37 #endif