love.graphics.drawLayer(canvas, …) now errors if the Canvas is currently active as a render target (matches behaviour of love.graphics.draw).

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-02-26 17:15:26 -04:00
parent 66b299822a
commit 9e94f5a375
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -48,6 +48,14 @@ void Canvas::draw(Graphics *gfx, Quad *q, const Matrix4 &t)
Texture::draw(gfx, q, t);
}
void Canvas::drawLayer(Graphics *gfx, int layer, Quad *quad, const Matrix4 &m)
{
if (gfx->isCanvasActive(this))
throw love::Exception("Cannot render a Canvas to itself!");
Texture::drawLayer(gfx, layer, quad, m);
}
} // graphics
} // love
+1
View File
@@ -58,6 +58,7 @@ public:
virtual ptrdiff_t getMSAAHandle() const = 0;
void draw(Graphics *gfx, Quad *q, const Matrix4 &t) override;
void drawLayer(Graphics *gfx, int layer, Quad *q, const Matrix4 &t) override;
static int canvasCount;