]> git.tdb.fi Git - libs/gl.git/commitdiff
Set the appropriate flags on Renderer state changes
authorMikko Rasa <tdb@tdb.fi>
Sat, 26 Nov 2016 04:52:39 +0000 (06:52 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 26 Nov 2016 04:52:39 +0000 (06:52 +0200)
source/renderer.cpp

index 3bef74b34039aa1db1db907eb648eff17ae69771..a0dc41516c0f90ba36ffa84070a8a7276809224a 100644 (file)
@@ -59,6 +59,7 @@ void Renderer::begin(const Camera *c)
                state->modelview_matrix = MatrixStack::modelview().top();
                standard_shdata.uniform("projection_matrix", MatrixStack::projection().top());
        }
+       changed |= MATRIX|STANDARD_SHDATA;
 }
 
 void Renderer::set_matrix(const Matrix &matrix)
@@ -113,7 +114,10 @@ void Renderer::set_clipping(const Clipping *c)
        state->clipping = c;
        state->clipping_matrix = state->modelview_matrix;
        if(c)
+       {
                c->update_shader_data(standard_shdata, state->clipping_matrix);
+               changed |= STANDARD_SHDATA;
+       }
        changed |= LEGACY_CLIPPING;
 }
 
@@ -171,13 +175,19 @@ void Renderer::pop_state()
        if(state->lighting!=old_lighting)
        {
                if(state->lighting)
+               {
                        state->lighting->update_shader_data(standard_shdata, state->lighting_matrix);
+                       changed |= STANDARD_SHDATA;
+               }
                changed |= LEGACY_LIGHTING;
        }
        if(state->clipping!=old_clipping)
        {
                if(state->clipping)
+               {
                        state->clipping->update_shader_data(standard_shdata, state->clipping_matrix);
+                       changed |= STANDARD_SHDATA;
+               }
                changed |= LEGACY_CLIPPING;
        }
 }