aboutsummaryrefslogtreecommitdiff
path: root/src/libjin-lua/scripts/graphics/graphics.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin-lua/scripts/graphics/graphics.lua')
-rw-r--r--src/libjin-lua/scripts/graphics/graphics.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libjin-lua/scripts/graphics/graphics.lua b/src/libjin-lua/scripts/graphics/graphics.lua
index 65a320f..423de74 100644
--- a/src/libjin-lua/scripts/graphics/graphics.lua
+++ b/src/libjin-lua/scripts/graphics/graphics.lua
@@ -160,3 +160,15 @@ jg.reset = function()
jg.unsetFont()
jg.unuseShader()
end
+
+jg.getStatsStr = function()
+ local stats = jin.graphics.getStats()
+ local str = "draw call: " .. stats.drawCalls .. '\n'
+ .. "canvas switches: " .. stats.canvasSwitches .. '\n'
+ .. "shader switches: " .. stats.shaderSwitches .. '\n'
+ .. "font switches: " .. stats.fontSwitches .. '\n'
+ .. "textures: " .. stats.textures .. '\n'
+ .. "canvases: " .. stats.canvases .. '\n'
+ .. "fonts: " .. stats.fonts
+ return str
+end \ No newline at end of file