X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbufferable.cpp;h=eb3f1c006e925244f1c58ff671e4d28237378f4a;hb=912ae952489699769be43f90d4478263461964a4;hp=1f6122e0914561e91338a80650351ea48ae28306;hpb=5c51ba1057b222ab44eca253828d58e107e80df0;p=libs%2Fgl.git diff --git a/source/bufferable.cpp b/source/bufferable.cpp index 1f6122e0..eb3f1c00 100644 --- a/source/bufferable.cpp +++ b/source/bufferable.cpp @@ -1,4 +1,5 @@ #include +#include "bindable.h" #include "buffer.h" #include "bufferable.h" @@ -81,8 +82,7 @@ void Bufferable::update_offset() void Bufferable::update_buffer() const { - const Buffer *old_buffer = Buffer::current(buffer->get_type()); - buffer->bind(); + BindRestore bind(buffer, buffer->get_type()); if(offset+get_data_size()>=buffer->get_size()) { const Bufferable *last = this; @@ -102,10 +102,6 @@ void Bufferable::update_buffer() const } upload_data(); - if(old_buffer) - old_buffer->bind_to(buffer->get_type()); - else - buffer->unbind(); dirty = false; }