]> git.tdb.fi Git - libs/vr.git/blob - source/stereocombiner.h
Add a StereoCombiner subclass for the Oculus Rift
[libs/vr.git] / source / stereocombiner.h
1 #ifndef MSP_GL_STEREOCOMBINER_H_
2 #define MSP_GL_STEREOCOMBINER_H_
3
4 #include <msp/geometry/angle.h>
5
6 namespace Msp {
7 namespace GL {
8
9 class Texture2D;
10
11 class StereoCombiner
12 {
13 protected:
14         unsigned width_div;
15         unsigned height_div;
16         bool keep_aspect;
17         Geometry::Angle<float> fov;
18         float oversize;
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
30         virtual void render(const Texture2D &, const Texture2D &) const = 0;
31 };
32
33 } // namespace GL
34 } // namespace Msp
35
36 #endif