X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fvertexarray.cpp;h=996871c4094ecc659566cd460175392c6b69600a;hp=e453a3f12a569a70f7868288647dee37c6f45b33;hb=c233a90fd05f1f5424d7fca94bb6b999f3061271;hpb=5c51ba1057b222ab44eca253828d58e107e80df0 diff --git a/source/vertexarray.cpp b/source/vertexarray.cpp index e453a3f1..996871c4 100644 --- a/source/vertexarray.cpp +++ b/source/vertexarray.cpp @@ -3,6 +3,7 @@ #include "buffer.h" #include "error.h" #include "gl.h" +#include "mesh.h" #include "vertexarray.h" using namespace std; @@ -112,6 +113,9 @@ void VertexArray::apply() const { 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