From: Mikko Rasa Date: Fri, 16 Sep 2016 08:21:35 +0000 (+0300) Subject: No longer inherit StereoView from GL::Renderable X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fa43a20e8274638b84c26e052dd8f7cc8993edd9;p=libs%2Fvr.git No longer inherit StereoView from GL::Renderable There really is no point in using it inside GL::Pipelines or other containers. --- diff --git a/source/stereoview.cpp b/source/stereoview.cpp index 95eb847..5b8dbbb 100644 --- a/source/stereoview.cpp +++ b/source/stereoview.cpp @@ -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 diff --git a/source/stereoview.h b/source/stereoview.h index b1e0473..842636e 100644 --- a/source/stereoview.h +++ b/source/stereoview.h @@ -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 &); - 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