No longer inherit StereoView from GL::Renderable
authorMikko Rasa <tdb@tdb.fi>
Fri, 16 Sep 2016 08:21:35 +0000 (11:21 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 16 Sep 2016 08:42:15 +0000 (11:42 +0300)
There really is no point in using it inside GL::Pipelines or other
containers.

source/stereoview.cpp
source/stereoview.h

index 95eb847d1b27a862b6d8513f3f122edd0f227058..5b8dbbbbb5bab8b8a8b5f62e5c9eaf1bc15518fa 100644 (file)
@@ -58,28 +58,16 @@ void StereoView::setup_frame() const
 
        left.setup_frame(base_camera, offset_axis*-eye_spacing, frustum_skew, params);
        right.setup_frame(base_camera, offset_axis*eye_spacing, -frustum_skew, params);
-
-       renderable.setup_frame();
-}
-
-void StereoView::finish_frame() const
-{
-       renderable.finish_frame();
 }
 
-void StereoView::render(const GL::Tag &tag) const
+void StereoView::render() const
 {
        setup_frame();
-       left.render(renderable, tag);
-       right.render(renderable, tag);
+       renderable.setup_frame();
+       left.render(renderable);
+       right.render(renderable);
+       renderable.finish_frame();
        combiner->render(left.target->color, right.target->color);
-       finish_frame();
-}
-
-void StereoView::render(GL::Renderer &renderer, const GL::Tag &tag) const
-{
-       renderer.escape();
-       return render(tag);
 }
 
 
@@ -117,12 +105,12 @@ void StereoView::Eye::setup_frame(const GL::Camera &base_camera, const GL::Vecto
        camera.set_frustum_axis(frustum_skew, 0);
 }
 
-void StereoView::Eye::render(const GL::Renderable &renderable, const GL::Tag &tag) const
+void StereoView::Eye::render(const GL::Renderable &renderable) const
 {
        GL::Bind bind_fbo(target->fbo);
        target->fbo.clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT);
        GL::Renderer renderer(&camera);
-       renderable.render(renderer, tag);
+       renderable.render(renderer);
 }
 
 } // namespace VR
index b1e0473029fec0e05ceb848f1aefd5c9f0fbe700..842636e6697ce780f23c39531c2d1d30dec4f19b 100644 (file)
@@ -13,7 +13,7 @@ namespace VR {
 
 class StereoCombiner;
 
-class StereoView: public GL::Renderable
+class StereoView
 {
 private:
        struct RenderTarget
@@ -42,7 +42,7 @@ private:
 
                void create_target(unsigned, unsigned);
                void setup_frame(const GL::Camera &, const GL::Vector3 &, float, const EyeParams &) const;
-               void render(const GL::Renderable &, const GL::Tag &) const;
+               void render(const GL::Renderable &) const;
        };
 
        unsigned width;
@@ -63,11 +63,10 @@ public:
        void set_eye_spacing(float);
        void set_strabismus(const Geometry::Angle<float> &);
 
-       virtual void setup_frame() const;
-       virtual void finish_frame() const;
-
-       virtual void render(const GL::Tag & = GL::Tag()) const;
-       virtual void render(GL::Renderer &, const GL::Tag & = GL::Tag()) const;
+private:
+       void setup_frame() const;
+public:
+       void render() const;
 };
 
 } // namespace VR