]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/engineer.cpp
Add the new 360mm C-track (24360)
[r2c2.git] / source / engineer / engineer.cpp
index 32b23ab900aa16ea6ab7009081d911ec8801a73a..e24365150fd25ec159c46b20f78b53ea0de91dbe 100644 (file)
@@ -73,7 +73,7 @@ Engineer::Engineer(int argc, char **argv):
        main_panel->set_position(0, window.get_height()-main_panel->get_geometry().h);
        main_panel->set_visible(true);
 
-       overlay = new Overlay3D(window, camera, ui_res.get_default_font());
+       overlay = new Overlay3D(ui_res.get_default_font());
 
        // Setup railroad control
        DataFile::load(catalogue, "tracks.dat");
@@ -100,6 +100,7 @@ Engineer::Engineer(int argc, char **argv):
        pipeline.set_camera(&camera);
        pipeline.add_renderable_for_pass(layout_3d.get_scene(), 0);
        pipeline.add_renderable_for_pass(layout_3d.get_path_scene(), "unlit");
+       pipeline.add_renderable_for_pass(*overlay, "overlay");
 
        light.set_position(GL::Vector4(0, -0.259, 0.966, 0));
        light.set_diffuse(GL::Color(0.9));
@@ -113,6 +114,9 @@ Engineer::Engineer(int argc, char **argv):
        pass = &pipeline.add_pass("unlit");
        pass->depth_test = &GL::DepthTest::lequal();
 
+       pass = &pipeline.add_pass("overlay");
+       pass->blend = &GL::Blend::alpha();
+
        view_all();
 
        // Catch various signals so we can stop the trains in case we get terminated
@@ -202,10 +206,6 @@ void Engineer::tick()
        GL::Framebuffer::system().clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT);
 
        pipeline.render_all();
-       {
-               GL::Bind blend(GL::Blend::alpha());
-               overlay->render(0);
-       }
 
        if(pointer_moved)
        {