|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( stats )
- A table with the following fields:
- The number of draw calls made so far during the current frame.
- The number of times the active Canvas has been switched so far during the current frame.
- The estimated total size in bytes of video memory used by all loaded Images, Canvases, and Fonts.
- The number of Image objects currently loaded.
- The number of Canvas objects currently loaded.
- The number of Font objects currently loaded.
display the estimated amount of video memory used for textures
function love.load() love.graphics.setNewFont(24) end function love.draw() 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
Tiếng Việt –