]> git.tdb.fi Git - libs/vr.git/blob - source/libovr/libovrcombiner.h
Add functions to use absolute tracking
[libs/vr.git] / source / libovr / libovrcombiner.h
1 #ifndef MSP_VR_LIBOVRCOMBINER_H_
2 #define MSP_VR_LIBOVRCOMBINER_H_
3
4 #include <msp/gl/mesh.h>
5 #include <msp/gl/program.h>
6 #include <msp/gl/programdata.h>
7 #include <msp/gl/view.h>
8 #include <msp/vr/stereocombiner.h>
9
10 namespace Msp {
11 namespace VR {
12
13 class LibOVRSystem;
14
15 /**
16 Presents a stereo view in a way suitable for an Oculus Rift HMD.  All distances
17 are specified in multiples of the screen width.
18 */
19 class LibOVRCombiner: public StereoCombiner
20 {
21 private:
22         struct Frustum;
23
24         LibOVRSystem &device;
25         GL::View &view;
26         GL::Mesh left_mesh;
27         GL::Mesh right_mesh;
28         GL::Program shprog;
29         mutable GL::ProgramData left_shdata;
30         mutable GL::ProgramData right_shdata;
31
32 public:
33         LibOVRCombiner(LibOVRSystem &, GL::View &);
34
35         virtual void prepare() const;
36         virtual void render(const GL::Texture2D &, const GL::Texture2D &) const;
37 };
38
39 } // namespace VR
40 } // namespace Msp
41
42 #endif