diff options
author | chai <chaifix@163.com> | 2018-09-07 13:30:44 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-09-07 13:30:44 +0800 |
commit | e72188433348c270a54879da9f086f1b527b580f (patch) | |
tree | b2cb92b37579c6f9cff77f52fc591426eb2d8286 /bin/main.lua | |
parent | 28ca1f570d417671904a25c2a9c589fdb1eb7a03 (diff) |
*update
Diffstat (limited to 'bin/main.lua')
-rw-r--r-- | bin/main.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/main.lua b/bin/main.lua index 885cfb4..4e57500 100644 --- a/bin/main.lua +++ b/bin/main.lua @@ -5,11 +5,13 @@ local img2 local canvas local sw, sh = jin.graphics.getSize() function jin.core.onLoad() - --local str = jin.filesystem.read("metaball.shader") - --shader = jin.graphics.newShader(str) - local bitmap = jin.graphics.newBitmap("img.png") - -- local bitmap2 = jin.graphics.newBitmap("img2.bmp") - img = jin.graphics.newTexture(bitmap) + local str = jin.filesystem.read("metaball.shader") + shader = jin.graphics.newShader(str) + local w, h = 256, 240 + local bitmap = jin.graphics.newBitmap(w, h, {255, 255, 0, 255}) + local b = bitmap:clone() + -- local bitmap2 = jin.graphics.newBitmap("img2.bmp") + img = jin.graphics.newTexture(b) -- img2 = jin.graphics.newTexture(bitmap2) canvas = jin.graphics.newCanvas(200, 200) end @@ -43,7 +45,7 @@ function jin.core.onDraw() -- shader:sendVec3("iResolution", sw, sh, 1) -- shader:sendVec4("iMouse", mx, my, mx, my) jin.graphics.draw(img, 0, 0, 1, 1) - --jin.graphics.unuseShader() + -- jin.graphics.unuseShader() jin.graphics.unbindCanvas() - jin.graphics.draw(canvas, 0, 0) + jin.graphics.draw(canvas, 0, 0, 1, 1) end
\ No newline at end of file |