From 98ab086f430d418f33c4410cf81f4eac52d5b835 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 20 Aug 2018 08:15:34 +0800 Subject: *update --- bin/main.lua | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 bin/main.lua (limited to 'bin/main.lua') diff --git a/bin/main.lua b/bin/main.lua deleted file mode 100644 index bd2c011..0000000 --- a/bin/main.lua +++ /dev/null @@ -1,41 +0,0 @@ -local loadAssets = [[ -local thread = jin.thread.getThread() -local path = thread:demand(1) -local img = jin.graphics.Image(path) -thread:send(2, img) -while(true) do - if(thread:receive(255)) then - break; -- quit thread - end -end -]] - -local img = nil -local loader = nil - -jin.core.onLoad = function() - loader = jin.thread.Thread("load assets", loadAssets) - loader:start() - loader:send(1, "./icon.png") - --img = jin.graphics.Image("./icon.png") -end - -jin.core.onEvent = function(e) - if e.type == "quit" then - jin.core.stop() - end -end - -jin.core.onUpdate = function(dt) - if loader:receive(2) and img == nil then - img = loader:fetch(2) - loader:send(255, 1) - loader:remove(2) - end -end - -jin.core.onDraw = function() - if img ~= nil then - jin.graphics.draw(img, 20, 20) - end -end -- cgit v1.1-26-g67d0