]> git.tdb.fi Git - libs/vr.git/blob - source/ovr/oculusriftdevice.h
Give combiners more control over rendering
[libs/vr.git] / source / ovr / oculusriftdevice.h
1 #ifndef MSP_VR_OCULUSRIFTDEVICE_H_
2 #define MSP_VR_OCULUSRIFTDEVICE_H_
3
4 #include <msp/vr/displaydevice.h>
5 #include "oculusriftcamera.h"
6 #include "oculusriftcombiner.h"
7
8 namespace Msp {
9 namespace VR {
10
11 class OculusRiftDevice: public DisplayDevice
12 {
13 public:
14         struct Private;
15
16 private:
17         Private *priv;
18         unsigned frame_index;
19         bool timing_active;
20
21         static unsigned n_instances;
22
23 public:
24         OculusRiftDevice();
25         virtual ~OculusRiftDevice();
26
27         const Private &get_private() const { return *priv; }
28
29         virtual void configure_view(StereoView &) const;
30         virtual OculusRiftCamera *create_camera(const GL::Camera &);
31         virtual OculusRiftCombiner *create_combiner(GL::View &);
32
33         void begin_frame();
34         void end_frame();
35         bool is_timing_active() const { return timing_active; }
36         double get_tracking_time() const;
37         double get_timewarp_time() const;
38         double get_current_time() const;
39 };
40
41 } // namespace VR
42 } // namespace Msp
43
44 #endif