diff options
Diffstat (limited to 'bin/main.lua')
-rw-r--r-- | bin/main.lua | 41 |
1 files changed, 0 insertions, 41 deletions
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 |