- matrix_mode(PROJECTION);
- push_matrix();
- load_identity();
- ortho(-radius, radius, -radius, radius, -radius, radius);
- matrix_mode(MODELVIEW);
- push_matrix();
- load_matrix(matrix);
-
- const Framebuffer *old_fbo = Framebuffer::current();
- fbo.bind();
- clear(DEPTH_BUFFER_BIT);
- scene.render("shadow");
+ MatrixStack::Push push_mv(MatrixStack::modelview());
+ MatrixStack::Push push_proj(MatrixStack::projection());
+
+ MatrixStack::projection() = Matrix::ortho(-radius, radius, -radius, radius, -radius, radius);
+ MatrixStack::modelview() = matrix;