From: Mikko Rasa Date: Thu, 17 Jan 2013 12:34:17 +0000 (+0200) Subject: Match changes in GL::Pipeline API X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ff6a2d7146e9e8981ae0f53815b71aabec31f063;p=r2c2.git Match changes in GL::Pipeline API --- diff --git a/source/3d/view.cpp b/source/3d/view.cpp index 002d480..4cd553d 100644 --- a/source/3d/view.cpp +++ b/source/3d/view.cpp @@ -15,9 +15,9 @@ View3D::View3D(Layout3D &l, unsigned w, unsigned h): pipeline.set_camera(&camera); pipeline.add_renderable_for_pass(layout.get_scene(), 0); - GL::PipelinePass *pass = &pipeline.add_pass(0); - pass->lighting = &layout.get_lighting(); - pass->depth_test = &GL::DepthTest::lequal(); + GL::Pipeline::Pass *pass = &pipeline.add_pass(0); + pass->set_lighting(&layout.get_lighting()); + pass->set_depth_test(&GL::DepthTest::lequal()); camera.set_up_direction(GL::Vector3(0, 0, 1)); // Y+, 60° down @@ -45,7 +45,7 @@ void View3D::view_all(bool tight) void View3D::render() { - pipeline.render_all(); + pipeline.render(); } } // namespace R2C2 diff --git a/source/designer/designer.cpp b/source/designer/designer.cpp index 07c2f78..c5f40bd 100644 --- a/source/designer/designer.cpp +++ b/source/designer/designer.cpp @@ -87,17 +87,17 @@ Designer::Designer(int argc, char **argv): main_view = new View3D(*layout_3d, window.get_width(), window.get_height()); GL::Pipeline *pipeline = &main_view->get_pipeline(); - GL::PipelinePass *pass = &pipeline->add_pass("unlit"); - pass->depth_test = &GL::DepthTest::lequal(); - pass->blend = &GL::Blend::alpha(); + GL::Pipeline::Pass *pass = &pipeline->add_pass("unlit"); + pass->set_depth_test(&GL::DepthTest::lequal()); + pass->set_blend(&GL::Blend::alpha()); pass = &pipeline->add_pass("blended"); - pass->lighting = &layout_3d->get_lighting(); - pass->depth_test = &GL::DepthTest::lequal(); - pass->blend = &GL::Blend::alpha(); + pass->set_lighting(&layout_3d->get_lighting()); + pass->set_depth_test(&GL::DepthTest::lequal()); + pass->set_blend(&GL::Blend::alpha()); pass = &pipeline->add_pass("overlay"); - pass->blend = &GL::Blend::alpha(); + pass->set_blend(&GL::Blend::alpha()); if(base_object) pipeline->add_renderable(*base_object); diff --git a/source/engineer/engineer.cpp b/source/engineer/engineer.cpp index 7d1e227..8b0c6b7 100644 --- a/source/engineer/engineer.cpp +++ b/source/engineer/engineer.cpp @@ -98,15 +98,15 @@ Engineer::Engineer(int argc, char **argv): lighting.set_ambient(GL::Color(0.4)); lighting.attach(0, light); - GL::PipelinePass *pass = &pipeline.add_pass(0); - pass->depth_test = &GL::DepthTest::lequal(); - pass->lighting = &lighting; + GL::Pipeline::Pass *pass = &pipeline.add_pass(0); + pass->set_depth_test(&GL::DepthTest::lequal()); + pass->set_lighting(&lighting); pass = &pipeline.add_pass("unlit"); - pass->depth_test = &GL::DepthTest::lequal(); + pass->set_depth_test(&GL::DepthTest::lequal()); pass = &pipeline.add_pass("overlay"); - pass->blend = &GL::Blend::alpha(); + pass->set_blend(&GL::Blend::alpha()); view_all(); @@ -196,7 +196,7 @@ void Engineer::tick() GL::Framebuffer::system().clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT); - pipeline.render_all(); + pipeline.render(); if(pointer_moved) { diff --git a/source/engineer/trainview.cpp b/source/engineer/trainview.cpp index c3d96fd..1ab236f 100644 --- a/source/engineer/trainview.cpp +++ b/source/engineer/trainview.cpp @@ -33,9 +33,9 @@ TrainView::TrainView(Engineer &e, const Train &t): pipeline.add_renderable(engineer.get_layout_3d().get_scene()); - GL::PipelinePass *pass = &pipeline.add_pass(0); - pass->depth_test = &GL::DepthTest::lequal(); - pass->lighting = &engineer.get_lighting(); + GL::Pipeline::Pass *pass = &pipeline.add_pass(0); + pass->set_depth_test(&GL::DepthTest::lequal()); + pass->set_lighting(&engineer.get_lighting()); GLtk::Image *image; add(*(image = new GLtk::Image(&tex))); @@ -111,7 +111,7 @@ void TrainView::prepare() GL::Bind _bind_fbo(fbo); fbo.clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT); - pipeline.render_all(); + pipeline.render(); } void TrainView::button_release(int x, int y, unsigned btn)