X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbatch.cpp;h=1b0c47bf976dd212aa4270a962d7f98a40f34761;hb=98cc25ffe956bc162c053c96df659ba40dfe2d6e;hp=7f9adff7aad42ca8a9cb8e3bd4758ff2048acb75;hpb=8b99547d099c96bd8cc6037e2026db123b2523c1;p=libs%2Fgl.git diff --git a/source/batch.cpp b/source/batch.cpp index 7f9adff7..1b0c47bf 100644 --- a/source/batch.cpp +++ b/source/batch.cpp @@ -196,11 +196,6 @@ void Batch::append_index(unsigned i) data.push_back(i); } -void Batch::upload_data() const -{ - get_buffer()->sub_data(get_offset(), data.size(), &data[0]); -} - unsigned Batch::get_index_size() const { if(data_type==UNSIGNED_SHORT) @@ -246,10 +241,10 @@ void Batch::draw() const restart_index = 0; } - if(Buffer *ibuf = get_buffer()) + Buffer *ibuf = get_buffer(); + BindRestore _bind_ibuf(ibuf, ELEMENT_ARRAY_BUFFER); + if(ibuf) { - BindRestore _bind_ibuf(ibuf, ELEMENT_ARRAY_BUFFER); - if(dirty) update_buffer();