From: Mikko Rasa Date: Sat, 21 Dec 2013 16:57:41 +0000 (+0200) Subject: Throw an exception if trying to draw a Mesh with a different Mesh bound X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=47af19a447e6c13257ca2d0aef606ea45f8a0d98;p=libs%2Fgl.git Throw an exception if trying to draw a Mesh with a different Mesh bound --- diff --git a/source/mesh.cpp b/source/mesh.cpp index 91dadeab..316e5a3a 100644 --- a/source/mesh.cpp +++ b/source/mesh.cpp @@ -1,6 +1,7 @@ #include #include #include "buffer.h" +#include "error.h" #include "mesh.h" #include "renderer.h" @@ -152,6 +153,10 @@ void Mesh::set_winding(const WindingTest *w) void Mesh::draw() const { + const Mesh *cur = current(); + if(cur && cur!=this) + throw invalid_operation("Mesh::draw"); + refresh(); if(!current())