X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fvertexarray.cpp;h=a2b65daa6d15dd91635c092a73e2434e76a9b51f;hb=e759062876ee7fc81d1c2f40818d5bf97898d53d;hp=de343bf7065a07aa573377a6e49be8114dd60356;hpb=b8fef9be469eb16e54068bac7e275ea225efc71c;p=libs%2Fgl.git diff --git a/source/vertexarray.cpp b/source/vertexarray.cpp index de343bf7..a2b65daa 100644 --- a/source/vertexarray.cpp +++ b/source/vertexarray.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -35,13 +35,13 @@ void VertexArray::use_vertex_buffer() if(vbuf && own_vbuf) return; - vbuf=new VertexBuffer(); + vbuf=new Buffer(ARRAY_BUFFER); own_vbuf=true; update_data(); } -void VertexArray::use_vertex_buffer(VertexBuffer *b) +void VertexArray::use_vertex_buffer(Buffer *b) { if(own_vbuf) delete vbuf; @@ -108,7 +108,7 @@ void VertexArray::apply() const glColorPointer(sz, GL_FLOAT, bpv, base+offset); break; default: - glVertexAttribPointerARB(t-3, sz, GL_FLOAT, false, bpv, base+offset); + glVertexAttribPointerARB(t-4, sz, GL_FLOAT, false, bpv, base+offset); break; } found|=1<>i)&1, 1<>i)&1, 1<unbind(); } /** @@ -134,7 +134,7 @@ void VertexArray::update_data() if(vbuf) { vbuf->data(data.size()*sizeof(float), &data[0]); - VertexBuffer::unbind(); + vbuf->unbind(); } }