Available since LÖVE 0.9.2
This function is not supported in earlier versions.

Gets performance-related rendering statistics.

O.png The per-frame metrics (drawcalls, canvasswitches, shaderswitches) are reset by, which for the default implementation of is called right after the execution of love.draw. Therefore this function should probably be called at the end of love.draw.  



stats = stats )


Available since LÖVE 11.0
table stats
A table which will be filled in with the stat fields below.


table stats
A table with the following fields:
number drawcalls
The number of draw calls made so far during the current frame.
number canvasswitches
The number of times the active Canvas has been switched so far during the current frame.
number texturememory
The estimated total size in bytes of video memory used by all loaded Images, Canvases, and Fonts.
number images
The number of Image objects currently loaded.
number canvases
The number of Canvas objects currently loaded.
number fonts
The number of Font objects currently loaded.
Available since LÖVE 0.10.2
number shaderswitches
The number of times the active Shader has been changed so far during the current frame.
Available since LÖVE 11.0
number drawcallsbatched
The number of draw calls that were saved by LÖVE's automatic batching, since the start of the frame.


display the estimated amount of video memory used for textures

function love.load()
function love.draw()
    local stats =
    local str = string.format("Estimated amount of texture memory used: %.2f MB", stats.texturememory / 1024 / 1024), 10, 10)

See Also

Other Languages