X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fshadowmap.cpp;h=c8730426e6a557b113440914bef162239bc02751;hb=955e7cada42e099016879332e71863e46075d72b;hp=bedfcfd51c0f1e2aa4d1f5bd374e1c5b8a342620;hpb=1d59ea8601436164f8bfc114da3941cb0871e87b;p=libs%2Fgl.git diff --git a/source/shadowmap.cpp b/source/shadowmap.cpp index bedfcfd5..c8730426 100644 --- a/source/shadowmap.cpp +++ b/source/shadowmap.cpp @@ -10,7 +10,6 @@ Distributed under the LGPL #include "light.h" #include "matrix.h" #include "misc.h" -#include "projection.h" #include "scene.h" #include "shadowmap.h" #include "texunit.h" @@ -98,22 +97,15 @@ void ShadowMap::prepare() matrix[15] = 1; { - matrix_mode(PROJECTION); - push_matrix(); - load_identity(); - ortho(-radius, radius, -radius, radius, -radius, radius); - matrix_mode(MODELVIEW); - push_matrix(); - load_matrix(matrix); + 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; Bind bind_fbo(fbo, true); fbo.clear(DEPTH_BUFFER_BIT); scene.render("shadow"); - - matrix_mode(PROJECTION); - pop_matrix(); - matrix_mode(MODELVIEW); - pop_matrix(); } depth_buf.bind_to(unit);