mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +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))
|
if (!supportsGenerateMipmaps(err))
|
||||||
throw love::Exception("%s", 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();
|
generateMipmapsInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user