]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexarray.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / vertexarray.cpp
index a13d79cc6b0abd3e0c42362b24dc56fc14e05d27..beffa64e0873fa66ee3d8f4228a76922abf1355c 100644 (file)
@@ -1,9 +1,4 @@
-#include <msp/gl/extensions/arb_multitexture.h>
-#include <msp/gl/extensions/arb_vertex_shader.h>
-#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);
@@ -33,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");
@@ -46,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();
 }