diff options
Diffstat (limited to 'bin/game/main.lua')
-rw-r--r-- | bin/game/main.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/game/main.lua b/bin/game/main.lua index 35c1695..7c94445 100644 --- a/bin/game/main.lua +++ b/bin/game/main.lua @@ -25,7 +25,7 @@ Vertex vert(Vertex v) Color frag(Color col, Texture tex, Vertex v) { Color c = texel(tex, v.uv); - return c * col; + return c; } #END_FRAGMENT_SHADER ]] @@ -37,11 +37,15 @@ local timer = nil local tb = {x = 1, y = 2} local t = 0 local spr = nil +local bitmap = nil function jin.core.onLoad() - jin.graphics.setClearColor(100, 100, 100, 255) + bitmap = jin.graphics.newBitmap(128, 128, function(w, h, x, y) + return {255*math.sin(x/w),255 - 255*math.cos(y/w),0,255} + end) shader_program = jin.graphics.newShader(shader) shader_program2 = jin.graphics.newShader(shader2) - tex = jin.graphics.newTexture("1.png") + --tex = jin.graphics.newTexture("1.png") + tex = jin.graphics.newTexture(bitmap) local ssheet = jin.graphics.newSpriteSheet(tex) spr = ssheet:newSprite(50, 50, 50, 50) spr:setPosition(0, 50) |