]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexarray.cpp
Use default member initializers for simple types
[libs/gl.git] / source / core / vertexarray.cpp
index b3bcb48118b291a114024bd86f7d9016d22a26b0..796bef8053c15a346273bd03beaa8c80abe73d74 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);
@@ -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();
 }