Error if Texture:generateMipmaps is called on an active canvas.

This commit is contained in:
Sasha Szpakowski
2024-04-14 11:31:46 -03:00
parent e04b5f931d
commit 3a672387e4
+4
View File
@@ -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();
}