X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fvertexarray.cpp;h=796bef8053c15a346273bd03beaa8c80abe73d74;hp=b3bcb48118b291a114024bd86f7d9016d22a26b0;hb=38712d8ecc57d043a2419ffbaeeb57f7a6586f14;hpb=a3cc9f4469153396c7ad0868f3cbb2d2f698d710 diff --git a/source/core/vertexarray.cpp b/source/core/vertexarray.cpp index b3bcb481..796bef80 100644 --- a/source/core/vertexarray.cpp +++ b/source/core/vertexarray.cpp @@ -1,9 +1,4 @@ -#include -#include -#include "buffer.h" #include "error.h" -#include "gl.h" -#include "mesh.h" #include "vertexarray.h" using namespace std; @@ -11,10 +6,6 @@ using namespace std; namespace Msp { namespace GL { -VertexArray::VertexArray(): - stride(0) -{ } - VertexArray::VertexArray(const VertexFormat &f) { set_format(f); @@ -40,7 +31,7 @@ void VertexArray::reserve(unsigned n) data.reserve(n*stride); } -float *VertexArray::append() +char *VertexArray::append() { if(format.empty()) throw invalid_operation("VertexArray::append"); @@ -50,7 +41,7 @@ float *VertexArray::append() return &*(data.end()-stride); } -float *VertexArray::modify(unsigned i) +char *VertexArray::modify(unsigned i) { if(format.empty()) throw invalid_operation("VertexArray::modify"); @@ -60,7 +51,7 @@ float *VertexArray::modify(unsigned i) unsigned VertexArray::get_data_size() const { - return data.size()*sizeof(float); + return data.size(); }