X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fvertexarray.cpp;fp=source%2Fvertexarray.cpp;h=72fd8a48ecddc802ec6a1bd0aa2cb985e3c9328a;hp=e8fa36a030bf5991a89bf4ed8f79944543ced413;hb=61ff840cd211f10d45dca8c4dad2cca5f68aaa42;hpb=8b99547d099c96bd8cc6037e2026db123b2523c1 diff --git a/source/vertexarray.cpp b/source/vertexarray.cpp index e8fa36a0..72fd8a48 100644 --- a/source/vertexarray.cpp +++ b/source/vertexarray.cpp @@ -125,19 +125,13 @@ void VertexArray::apply() const return; Buffer *vbuf = get_buffer(); - if(vbuf) - { - vbuf->bind_to(ARRAY_BUFFER); - if(dirty) - update_buffer(); - } + Bind _bind_vbuf(vbuf, ARRAY_BUFFER); + if(vbuf && dirty) + update_buffer(); const float *base = (vbuf ? reinterpret_cast(get_offset()) : &data[0]); unsigned stride_bytes = stride*sizeof(float); apply_arrays(&arrays, (old ? &old->arrays : 0), base, stride_bytes); - - if(vbuf) - Buffer::unbind_from(ARRAY_BUFFER); } void VertexArray::apply_arrays(const vector *arrays, const vector *old_arrays, const float *base, unsigned stride_bytes)