#include "buffer.h"
#include "error.h"
#include "gl.h"
+#include "mesh.h"
#include "vertexarray.h"
using namespace std;
namespace Msp {
namespace GL {
-VertexArray::VertexArray(const VertexFormat &f):
- dirty(false)
+VertexArray::VertexArray(const VertexFormat &f)
{
reset(f);
}
{
if(format.empty())
throw invalid_operation("VertexArray::apply");
+ // Don't mess up the vertex array object of a mesh
+ if(Mesh::current())
+ throw invalid_operation("VertexArray::apply");
const VertexArray *old = current();
/* If the array has been modified, apply it even if it was the last one to