Available since LÖVE 0.9.2
This function is not supported in earlier versions.
Gets performance-related rendering statistics.
The per-frame metrics (drawcalls, canvasswitches, shaderswitches) are reset by love.graphics.present, which for the default implementation of love.run is called right after the execution of love.draw. Therefore this function should probably be called at the end of love.draw.
stats = love.graphics.getStats( )
None.
table statsnumber drawcallsnumber canvasswitchesnumber texturememorynumber imagesnumber canvasesnumber fontsnumber drawcallsbatched Available since 11.0
Available since LÖVE 11.0
This variant is not supported in earlier versions.
This variant accepts an existing table to fill in, instead of creating a new one.
stats = love.graphics.getStats( stats )
table statstable statsnumber drawcallsnumber canvasswitchesnumber texturememorynumber imagesnumber canvasesnumber fontsnumber shaderswitchesnumber drawcallsbatchedfunction love.load()
love.graphics.setNewFont(24)
end
function love.draw()
-- some drawing code here --
local stats = love.graphics.getStats()
local str = string.format("Estimated amount of texture memory used: %.2f MB", stats.texturememory / 1024 / 1024)
love.graphics.print(str, 10, 10)
end
© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.graphics.getStats