diff options
author | chai <chaifix@163.com> | 2018-08-01 08:41:00 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-01 08:41:00 +0800 |
commit | 5f9dc5209d621d6ce7d27936a24b23589142d0ae (patch) | |
tree | 905301682972c92a819ee746948ba9bea4da3ffe /main.lua | |
parent | 0efe3cf55bde25c0627899b36dbe1694dd338234 (diff) |
*update
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,11 +1,14 @@ local loghelper = require("loghelper") loghelper.strict(loghelper.LEVEL.INFO) +local global = require("global.global") local timer = require("timer.timer") +global.set("frame", 0) -jin.core.load = function() +jin.core.onLoad = function() timer.every(1.0, function() - loghelper.log(loghelper.LEVEL.INFO, "test") + loghelper.log(loghelper.LEVEL.INFO, global.get("frame") .. "fps") + global.set("frame", 0) end) end @@ -19,11 +22,12 @@ jin.core.onEvent = function(e) end end -jin.core.onUpdate = function(dt) +jin.core.onUpdate = function(dt) + global.set("frame", _G['frame'] + 1) timer.update(dt) -- loghelper.log(loghelper.LEVEL.WARN, "版本" .. jin.revision()) end jin.core.onDraw = function() -end
\ No newline at end of file +end |