X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbatch.cpp;h=7100653ea17800cf9ebd6364e6d5fba41443948b;hb=912ae952489699769be43f90d4478263461964a4;hp=09a6a6111314262d57b7607939da42a74ecc3f89;hpb=00fddb7f46bf0164f74a99f8f5f0081ce969260a;p=libs%2Fgl.git diff --git a/source/batch.cpp b/source/batch.cpp index 09a6a611..7100653e 100644 --- a/source/batch.cpp +++ b/source/batch.cpp @@ -4,6 +4,7 @@ #include "bindable.h" #include "buffer.h" #include "error.h" +#include "mesh.h" #include "vertexarray.h" using namespace std; @@ -245,11 +246,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) { - BufferAlias alias(*ibuf); - Bind bind_ibuf(alias, true); - if(dirty) update_buffer();