X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Frenderer.cpp;h=c744ac5a825009f588c305657f7938daf97b7178;hp=c8972934cb304d34b22ed3a2f68147c7b7d74c48;hb=b47e6e72485b1cd978bf35d2b3d2818d8a036cfe;hpb=f02daac8305327d403e947e23c4f2d231eced417 diff --git a/source/renderer.cpp b/source/renderer.cpp index c8972934..c744ac5a 100644 --- a/source/renderer.cpp +++ b/source/renderer.cpp @@ -33,6 +33,8 @@ Renderer::Renderer(const Camera *c): if(c) set_camera(*c); + else + standard_shdata.uniform("projection_matrix", Matrix()); } Renderer::~Renderer() @@ -169,7 +171,10 @@ void Renderer::pop_state() bool camera_changed = (state->camera!=old_camera); if(camera_changed) { - standard_shdata.uniform("projection_matrix", state->camera->get_projection_matrix()); + if(state->camera) + standard_shdata.uniform("projection_matrix", state->camera->get_projection_matrix()); + else + standard_shdata.uniform("projection_matrix", Matrix()); changed |= STANDARD_SHDATA|LEGACY_PROJECTION; } /* This actually should compare the relevant matrices rather than check for