{{newin (日本語)|[[0.9.2 (日本語)|0.9.2]]|092|type=関数}}
Gets performance-related rendering statistics. 


{{notice|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]].}}

== 関数 ==
=== 概要 ===
<source lang="lua">
stats = love.graphics.getStats( )
</source>
=== 引数 ===
なし。
=== 返値 ===
{{param (日本語)|table|stats|A table with the following fields:}}
{{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|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|canvases|The number of [[Canvas]] objects currently loaded.}}
{{subparam|number|fonts|The number of [[Font]] objects currently loaded.}}
{{New feature (日本語)|11.0|
{{subparam|number|shaderswitches|The number of times the active [[Shader]] has been changed so far during the current frame.}}
}}{{New feature|11.0|
{{subparam|number|drawcallsbatched|The number of draw calls that were saved by LÖVE's automatic batching, since the start of the frame.}}
}}

== 関数 ==
{{newin (日本語)|[[11.0 (日本語)|11.0]]|110|type=異形}}
This variant accepts an existing table to fill in, instead of creating a new one.
=== 概要 ===
<source lang="lua">
stats = love.graphics.getStats( stats )
</source>
=== 引数 ===
{{param (日本語)|table|stats|A table which will be filled in with the stat fields below.}}
=== 返値 ===
{{param (日本語)|table|stats|The table that was passed in above, now containing the following fields:}}
{{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|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|canvases|The number of [[Canvas]] objects currently loaded.}}
{{subparam|number|fonts|The number of [[Font]] objects currently loaded.}}
{{subparam|number|shaderswitches|The number of times the active [[Shader]] has been changed so far during the current frame.}}
{{subparam|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 ===
<source lang="lua">
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
</source>
== 関連 ==
* [[parent::love.graphics (日本語)]]
[[Category:Functions (日本語)]]
{{#set:Sub-Category=SystemInfo (日本語)}}
{{#set:Description=Gets performance-related rendering statistics.}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.getStats}}