]> git.tdb.fi Git - libs/vr.git/blob - source/oculusriftcombiner.h
Chromatic aberration correction is always included in distortion
[libs/vr.git] / source / oculusriftcombiner.h
1 #ifndef MSP_VR_OCULUSRIFTCOMBINER_H_
2 #define MSP_VR_OCULUSRIFTCOMBINER_H_
3
4 #include <msp/gl/mesh.h>
5 #include <msp/gl/program.h>
6 #include <msp/gl/programdata.h>
7 #include "stereocombiner.h"
8
9 namespace Msp {
10 namespace VR {
11
12 class OculusRiftDevice;
13
14 /**
15 Presents a stereo view in a way suitable for an Oculus Rift HMD.  All distances
16 are specified in multiples of the screen width.
17 */
18 class OculusRiftCombiner: public StereoCombiner
19 {
20 private:
21         const OculusRiftDevice &device;
22         GL::Mesh left_mesh;
23         GL::Mesh right_mesh;
24         GL::Program shprog;
25         mutable GL::ProgramData left_shdata;
26         mutable GL::ProgramData right_shdata;
27
28 public:
29         OculusRiftCombiner(const OculusRiftDevice &);
30
31         virtual void render(const GL::Texture2D &, const GL::Texture2D &) const;
32 };
33
34 } // namespace VR
35 } // namespace Msp
36
37 #endif