diff options
Diffstat (limited to 'bin/game/main.lua')
-rw-r--r-- | bin/game/main.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/game/main.lua b/bin/game/main.lua index 8128bb6..e45958f 100644 --- a/bin/game/main.lua +++ b/bin/game/main.lua @@ -108,6 +108,8 @@ function jin.core.onLoad() timer:every(1, function() jin.log.info(jin.time.getFPS() .. " fps") + local stats = jin.graphics.getStats() + jin.log.info("textures " .. stats.textures) end) --local xmlParser = jin.utils.xml.newParser() @@ -157,4 +159,11 @@ function jin.core.onDraw() jin.graphics.useShader(sinShader) jin.graphics.rect(jin.graphics.RenderMode.FILL, 300, 300, 100, 50) jin.graphics.unuseShader() + + local stats = jin.graphics.getStats() + jin.graphics.print("draw call: " .. stats.drawCalls, 450, 10) + jin.graphics.print("canvas switches: " .. stats.canvasSwitches, 450, 30) + jin.graphics.print("shader switches: " .. stats.shaderSwitches, 450, 50) + jin.graphics.print("font switches: " .. stats.fontSwitches, 450, 70) + end
\ No newline at end of file |