]> git.tdb.fi Git - libs/gl.git/blobdiff - source/bufferable.cpp
Clear the dirty flag of Bufferable in upload_data
[libs/gl.git] / source / bufferable.cpp
index 3178e0adefa38f72e2d8aa22ecbae6769c50cdc7..6b770a8f68f2c447bb18fe608930cba4bf9e6ab7 100644 (file)
@@ -124,7 +124,6 @@ void Bufferable::update_buffer() const
        }
 
        upload_data(0);
-       dirty = false;
 }
 
 void Bufferable::upload_data(char *target) const
@@ -136,6 +135,7 @@ void Bufferable::upload_data(char *target) const
        }
        else
                buffer->sub_data(offset, get_data_size(), get_data_pointer());
+       dirty = false;
 }
 
 
@@ -157,16 +157,10 @@ void Bufferable::AsyncUpdater::upload_data()
        // Update all bufferables in the same buffer at once
        for(const Bufferable *b=bufferable.prev_in_buffer; b; b=b->prev_in_buffer)
                if(b->dirty || buffer_resized)
-               {
                        b->upload_data(mapped_address+b->offset);
-                       b->dirty = false;
-               }
        for(const Bufferable *b=bufferable.next_in_buffer; b; b=b->next_in_buffer)
                if(b->dirty || buffer_resized)
-               {
                        b->upload_data(mapped_address+b->offset);
-                       b->dirty = false;
-               }
 }
 
 } // namespace GL