/* $Id$
This file is part of libmspgl
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
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;
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<<t;
set_array(GL_TEXTURE_COORD_ARRAY, found&4, 4);
set_array(GL_COLOR_ARRAY, found&8, 8);
for(unsigned i=4; i<32; ++i)
- set_array(i-3, (found>>i)&1, 1<<i);
+ set_array(i-4, (found>>i)&1, 1<<i);
if(vbuf)
- VertexBuffer::unbind();
+ vbuf->unbind();
}
/**
if(vbuf)
{
vbuf->data(data.size()*sizeof(float), &data[0]);
- VertexBuffer::unbind();
+ vbuf->unbind();
}
}