#include "buffer.h"
#include "error.h"
#include "gl.h"
+#include "mesh.h"
#include "vertexarray.h"
using namespace std;
{
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