Available since LÖVE 0.10.0
This function is not supported in earlier versions.
Discards (trashes) the contents of the screen or active Canvas. This is a performance optimization function with niche use cases.
If the active Canvas has just been changed and the "replace" BlendMode is about to be used to draw something which covers the entire screen, calling love.graphics.discard rather than calling love.graphics.clear or doing nothing may improve performance on mobile devices.
On some desktop systems this function may do nothing.
This function effectively replaces the contents of the screen or active Canvas with garbage. Most BlendModes, including the default "alpha" blend mode, blend what's drawn with the contents of the screen - which would cause unexpected glitches if this function is used inappropriately.
love.graphics.discard( discardcolor, discardstencil )
boolean discardcolor (true)
boolean discardstencil (true)
Nothing.
love.graphics.discard( discardcolors, discardstencil )
table discardcolors
boolean discardstencil (true)
Nothing.
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.graphics.discard