From 47af19a447e6c13257ca2d0aef606ea45f8a0d98 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 21 Dec 2013 18:57:41 +0200 Subject: [PATCH] Throw an exception if trying to draw a Mesh with a different Mesh bound --- source/mesh.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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()) -- 2.43.0