From 039e2541207232e0a382a52a65122a15eed9257d Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 24 Dec 2018 19:15:02 +0800 Subject: +physics module --- src/libjin-lua/scripts/graphics/graphics.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/libjin-lua/scripts/graphics/graphics.lua') 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 -- cgit v1.1-26-g67d0