diff --git a/src/modules/graphics/Canvas.cpp b/src/modules/graphics/Canvas.cpp index 711de0032..280936e2d 100644 --- a/src/modules/graphics/Canvas.cpp +++ b/src/modules/graphics/Canvas.cpp @@ -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 diff --git a/src/modules/graphics/Canvas.h b/src/modules/graphics/Canvas.h index 49ac879d8..6686355b8 100644 --- a/src/modules/graphics/Canvas.h +++ b/src/modules/graphics/Canvas.h @@ -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;