Difference between revisions of "love.graphics.getStats"
m |
m (Updated for 0.10.2) |
||
Line 12: | Line 12: | ||
{{subparam|number|drawcalls|The number of draw calls made so far during the current frame.}} | {{subparam|number|drawcalls|The number of draw calls made so far during the current frame.}} | ||
{{subparam|number|canvasswitches|The number of times the active [[Canvas]] has been switched so far during the current frame.}} | {{subparam|number|canvasswitches|The number of times the active [[Canvas]] has been switched so far during the current frame.}} | ||
− | {{subparam|number|texturememory|The estimated total size in bytes of video memory used by all loaded | + | {{subparam|number|texturememory|The estimated total size in bytes of video memory used by all loaded [[Image]]s, [[Canvas]]es, and [[Font]]s.}} |
{{subparam|number|images|The number of [[Image]] objects currently loaded.}} | {{subparam|number|images|The number of [[Image]] objects currently loaded.}} | ||
{{subparam|number|canvases|The number of [[Canvas]] objects currently loaded.}} | {{subparam|number|canvases|The number of [[Canvas]] objects currently loaded.}} | ||
{{subparam|number|fonts|The number of [[Font]] objects currently loaded.}} | {{subparam|number|fonts|The number of [[Font]] objects currently loaded.}} | ||
+ | {{New feature|0.10.2| | ||
+ | {{subparam|number|shaderswitches|The number of times the active [[Shader]] has been changed so far during the current frame.}} | ||
+ | }} | ||
== Examples == | == Examples == | ||
=== display the estimated amount of video memory used for textures === | === display the estimated amount of video memory used for textures === |
Revision as of 21:15, 30 October 2016
Available since LÖVE 0.9.2 |
This function is not supported in earlier versions. |
Gets performance-related rendering statistics.
Contents
Function
Synopsis
stats = love.graphics.getStats( )
Arguments
None.
Returns
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
Examples
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
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info