mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Error if Texture:generateMipmaps is called on an active canvas.
This commit is contained in:
@@ -701,6 +701,10 @@ void Texture::generateMipmaps()
|
||||
if (!supportsGenerateMipmaps(err))
|
||||
throw love::Exception("%s", err);
|
||||
|
||||
auto gfx = Module::getInstance<Graphics>(Module::M_GRAPHICS);
|
||||
if (gfx != nullptr && gfx->isRenderTargetActive(this))
|
||||
throw love::Exception("generateMipmaps cannot be called on this Texture while it's an active render target.");
|
||||
|
||||
generateMipmapsInternal();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user