]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/designer.cpp
Mscellaneous adaptations to mspgl API changes
[r2c2.git] / source / designer / designer.cpp
index d73ef70ba36833dc40cd485e412487a2dd261d17..e67c36f71377dabf1f7973f4813505c153bc9ffc 100644 (file)
@@ -38,8 +38,6 @@ using namespace std;
 using namespace R2C2;
 using namespace Msp;
 
-Application::RegApp<Designer> Designer::reg;
-
 Designer::Designer(int argc, char **argv):
        window(1280, 960),
        ui_res("r2c2.res"),
@@ -89,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);
@@ -515,16 +513,8 @@ void Designer::render()
                measure.render();
        }
 
-       GL::matrix_mode(GL::PROJECTION);
-       GL::load_identity();
-       GL::ortho_bottomleft(window.get_width(), window.get_height());
-       GL::matrix_mode(GL::MODELVIEW);
-       GL::load_identity();
-
-       GL::Bind bind_blend(GL::Blend::alpha());
        root.render();
-       // XXX Should fix GLtk so these would not be needed
-       GL::Texture::unbind();
+       // XXX Should fix GLtk so this would not be needed
        glColor3f(1.0, 1.0, 1.0);
 }
 
@@ -562,14 +552,14 @@ void Designer::update_track_icon(Track3D &track)
        if(unsigned sid = track.get_track().get_sensor_id())
        {
                overlay->add_graphic(track, "sensor");
-               overlay->set_label(track, lexical_cast(sid));
+               overlay->set_label(track, lexical_cast<string>(sid));
        }
        else if(unsigned tid = track.get_track().get_turnout_id())
        {
                if(tid<0x800)
                {
                        overlay->add_graphic(track, "turnout");
-                       overlay->set_label(track, lexical_cast(tid));
+                       overlay->set_label(track, lexical_cast<string>(tid));
                }
        }
 }