X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuffer.cpp;h=1226dbe3223f41e438ddcc7ca1c2f9b107b0fd17;hb=57de40e1e802e44ae5b4caa67b0bb8763828b5c3;hp=93ef98db60ad32654309945d505726d9255414d0;hpb=0ef8e620a008e92069b0dd9ae4e972bc69430fc7;p=libs%2Fgl.git diff --git a/source/buffer.cpp b/source/buffer.cpp index 93ef98db..1226dbe3 100644 --- a/source/buffer.cpp +++ b/source/buffer.cpp @@ -1,7 +1,4 @@ #include -#include -#include -#include #include "buffer.h" #include "error.h" #include "mesh.h" @@ -160,9 +157,12 @@ void BufferRange::bind_to(BufferType t, unsigned i) { if(t!=buffer.type) Buffer::require_buffer_type(t); - // Intentionally using bitwise | to avoid short-circuiting - if(Buffer::set_current(t, &buffer) | set_current(t, i, this)) + if(set_current(t, i, this)) + { + // The buffer gets bound as a side effect + Buffer::set_current(t, &buffer); glBindBufferRange(t, i, buffer.id, offset, size); + } } void BufferRange::unbind_from(BufferType t, unsigned i)