X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fvertexarray.cpp;h=beffa64e0873fa66ee3d8f4228a76922abf1355c;hb=e1be82a4dfce8d90358c506f65be09da4dc9d5ec;hp=30bc9bcc6588ae9233fe7491cc30f49dcf403124;hpb=acaefb4c669f01855252818ef0a2958cbdababc3;p=libs%2Fgl.git diff --git a/source/core/vertexarray.cpp b/source/core/vertexarray.cpp index 30bc9bcc..beffa64e 100644 --- a/source/core/vertexarray.cpp +++ b/source/core/vertexarray.cpp @@ -6,10 +6,6 @@ using namespace std; namespace Msp { namespace GL { -VertexArray::VertexArray(): - stride(0) -{ } - VertexArray::VertexArray(const VertexFormat &f) { set_format(f); @@ -28,7 +24,7 @@ void VertexArray::clear() data.clear(); } -void VertexArray::reserve(unsigned n) +void VertexArray::reserve(size_t n) { if(format.empty()) throw invalid_operation("VertexArray::reserve"); @@ -41,19 +37,19 @@ char *VertexArray::append() throw invalid_operation("VertexArray::append"); data.insert(data.end(), stride, 0.0f); update_offset(); - dirty = true; + mark_dirty(); return &*(data.end()-stride); } -char *VertexArray::modify(unsigned i) +char *VertexArray::modify(size_t i) { if(format.empty()) throw invalid_operation("VertexArray::modify"); - dirty = true; + mark_dirty(); return &data[0]+i*stride; } -unsigned VertexArray::get_data_size() const +size_t VertexArray::get_data_size() const { return data.size(); }