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);
}
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
class StereoCombiner;
-class StereoView: public GL::Renderable
+class StereoView
{
private:
struct RenderTarget
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;
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