mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
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:
@@ -48,6 +48,14 @@ void Canvas::draw(Graphics *gfx, Quad *q, const Matrix4 &t)
|
|||||||
Texture::draw(gfx, q, 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
|
} // graphics
|
||||||
} // love
|
} // love
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public:
|
|||||||
virtual ptrdiff_t getMSAAHandle() const = 0;
|
virtual ptrdiff_t getMSAAHandle() const = 0;
|
||||||
|
|
||||||
void draw(Graphics *gfx, Quad *q, const Matrix4 &t) override;
|
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;
|
static int canvasCount;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user