20a4a5e0e948d73778ceb139f64214f7864dfe52
[libs/vr.git] / source / ovr / oculusriftsystem.h
1 #ifndef MSP_VR_OCULUSRIFTSYSTEM_H_
2 #define MSP_VR_OCULUSRIFTSYSTEM_H_
3
4 #include <msp/vr/system.h>
5 #include "oculusriftcamera.h"
6 #include "oculusriftcombiner.h"
7
8 namespace Msp {
9 namespace VR {
10
11 class OculusRiftSystem: public System
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         OculusRiftSystem();
25         virtual ~OculusRiftSystem();
26
27         const Private &get_private() const { return *priv; }
28
29         virtual void configure_window(Graphics::Window &) const;
30         virtual void configure_view(StereoView &) const;
31         virtual OculusRiftCamera *create_camera(const GL::Camera &);
32         virtual OculusRiftCombiner *create_combiner(GL::View &);
33
34         void begin_frame();
35         void end_frame();
36         bool is_timing_active() const { return timing_active; }
37         double get_tracking_time() const;
38         double get_timewarp_time() const;
39         double get_current_time() const;
40 };
41
42 } // namespace VR
43 } // namespace Msp
44
45 #endif