]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pipeline.cpp
Move PipelinePass inside Pipeline and make the data members private
[libs/gl.git] / source / pipeline.cpp
index 8757ea92e87e54a6a0e1b0dc33afe1c7f5b006e3..ce15597080618114fc719e1e332732f20809cb76 100644 (file)
@@ -58,19 +58,19 @@ void Pipeline::set_camera(const Camera *c)
        camera = c;
 }
 
-PipelinePass &Pipeline::add_pass(const Tag &tag)
+Pipeline::Pass &Pipeline::add_pass(const Tag &tag)
 {
-       PipelinePass &pass = insert_unique(passes, tag, PipelinePass())->second;
+       Pass &pass = insert_unique(passes, tag, Pass())->second;
        pass_order.push_back(tag);
        return pass;
 }
 
-PipelinePass &Pipeline::get_pass(const Tag &tag)
+Pipeline::Pass &Pipeline::get_pass(const Tag &tag)
 {
        return get_item(passes, tag);
 }
 
-const PipelinePass &Pipeline::get_pass(const Tag &tag) const
+const Pipeline::Pass &Pipeline::get_pass(const Tag &tag) const
 {
        return get_item(passes, tag);
 }
@@ -121,11 +121,11 @@ void Pipeline::add_postprocessor(PostProcessor &pp)
 
 void Pipeline::render(Renderer &renderer, const Tag &tag) const
 {
-       const PipelinePass &pass = get_pass(tag);
+       const Pass &pass = get_pass(tag);
 
-       Bind bind_depth_test(pass.depth_test);
-       Bind bind_blend(pass.blend);
-       Bind bind_lighting(pass.lighting);
+       Bind bind_depth_test(pass.get_depth_test());
+       Bind bind_blend(pass.get_blend());
+       Bind bind_lighting(pass.get_lighting());
 
        for(vector<Slot>::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
                if(i->passes.empty() || i->passes.count(tag))
@@ -204,6 +204,28 @@ void Pipeline::create_fbos()
 }
 
 
+Pipeline::Pass::Pass():
+       lighting(0),
+       depth_test(0),
+       blend(0)
+{ }
+
+void Pipeline::Pass::set_lighting(const Lighting *l)
+{
+       lighting = l;
+}
+
+void Pipeline::Pass::set_depth_test(const DepthTest *d)
+{
+       depth_test = d;
+}
+
+void Pipeline::Pass::set_blend(const Blend *b)
+{
+       blend = b;
+}
+
+
 Pipeline::Slot::Slot(const Renderable *r):
        renderable(r)
 { }