]> git.tdb.fi Git - libs/vr.git/blobdiff - source/stereoview.h
Fix memory leaks
[libs/vr.git] / source / stereoview.h
index bc9073ed5808ebf8e9802bdbd92f21d673fd584f..75361ba13abd56acf8cc50feb0585e75daa41f24 100644 (file)
@@ -12,6 +12,7 @@ namespace Msp {
 namespace VR {
 
 class HeadTrackingCamera;
+class MotionController;
 class StereoCombiner;
 
 class StereoView
@@ -41,6 +42,7 @@ private:
                RenderTarget *target;
 
                Eye();
+               ~Eye();
 
                void create_target(unsigned, unsigned);
                void setup_frame(const GL::Camera &, float, const EyeParams &) const;
@@ -54,6 +56,7 @@ private:
        Eye left;
        Eye right;
        Geometry::Angle<float> strabismus;
+       std::vector<MotionController *> controllers;
 
 public:
        StereoView(const StereoCombiner &, const GL::Camera &);
@@ -62,11 +65,16 @@ private:
        void init();
 
 public:
+       const GL::Camera &get_base_camera() const { return base_camera; }
+       const HeadTrackingCamera *get_head_camera() const { return head_camera; }
        void set_content(const GL::Renderable *);
        void set_eye_spacing(float);
        void set_eye_matrices(const GL::Matrix &, const GL::Matrix &);
        void set_strabismus(const Geometry::Angle<float> &);
 
+       void add_controller(MotionController &);
+       void remove_controller(MotionController &);
+
 private:
        void setup_frame() const;
 public: