#include <msp/gl/misc.h>
#include <msp/gl/projection.h>
#include <msp/gl/tests.h>
-#include <msp/gl/transform.h>
#include <msp/io/print.h>
#include <msp/strings/format.h>
#include <msp/time/units.h>
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();
GL::Framebuffer::system().clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT);
- pipeline.render_all();
+ pipeline.render();
if(pointer_moved)
{
if(picking && picking_track && picking_entry>=0)
{
- GL::PushMatrix push_mat;
+ GL::MatrixStack::Push push_mat(GL::MatrixStack::modelview());
float rot = picking_track->get_endpoint_direction(picking_entry);
Vector pos = picking_track->get_endpoint_position(picking_entry);
- GL::translate(pos.x, pos.y, pos.z+0.03);
- GL::rotate(rot*180/M_PI+180, 0, 0, 1);
+ GL::MatrixStack::modelview() *= GL::Matrix::translation(pos.x, pos.y, pos.z+0.03);
+ GL::MatrixStack::modelview() *= GL::Matrix::rotation(rot+M_PI, 0, 0, 1);
arrow_mesh.draw();
}
- const GLtk::Geometry &rgeom = root->get_geometry();
- GL::matrix_mode(GL::PROJECTION);
- GL::load_identity();
- GL::ortho_bottomleft(rgeom.w, rgeom.h);
- GL::matrix_mode(GL::MODELVIEW);
- GL::load_identity();
-
- {
- GL::Bind blend(GL::Blend::alpha());
- root->render();
- GL::Texture::unbind();
- }
+ root->render();
window.swap_buffers();
}