X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuffer.cpp;h=066ab96c5919b2c154879224323f704662ce2e14;hb=d42fdf115dfd6f3e5e2f83f2c2f905fb02fc1af4;hp=93ef98db60ad32654309945d505726d9255414d0;hpb=5ae4b0008b25072b5716f0cb585133315625a661;p=libs%2Fgl.git diff --git a/source/buffer.cpp b/source/buffer.cpp index 93ef98db..066ab96c 100644 --- a/source/buffer.cpp +++ b/source/buffer.cpp @@ -160,9 +160,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)