X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fbatch.cpp;h=09a6a6111314262d57b7607939da42a74ecc3f89;hp=34bd83c0d7ac07683bc3bea118c9d33a46f3e012;hb=00fddb7f46bf0164f74a99f8f5f0081ce969260a;hpb=cfd7b5bc0c69d0b8cc7c8b3ec81a1a9462d04abb diff --git a/source/batch.cpp b/source/batch.cpp index 34bd83c0..09a6a611 100644 --- a/source/batch.cpp +++ b/source/batch.cpp @@ -245,14 +245,14 @@ void Batch::draw() const restart_index = 0; } - if(get_buffer()) + if(Buffer *ibuf = get_buffer()) { + BufferAlias alias(*ibuf); + Bind bind_ibuf(alias, true); + if(dirty) update_buffer(); - BufferAlias alias(*get_buffer()); - Bind bind_ibuf(alias, true); - glDrawRangeElements(prim_type, min_index, max_index, size(), data_type, reinterpret_cast(get_offset())); } else