diff options
Diffstat (limited to 'bin/game/main.lua')
-rw-r--r-- | bin/game/main.lua | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/bin/game/main.lua b/bin/game/main.lua index 2cc8bcc..0824509 100644 --- a/bin/game/main.lua +++ b/bin/game/main.lua @@ -1,50 +1,7 @@ io.stdout:setvbuf("no") -local shader = [[ -#VERTEX_SHADER - Vertex vert(Vertex v) - { - return v; - } - -#END_VERTEX_SHADER - -#FRAGMENT_SHADER - - Color frag(Color col, Texture tex, Vertex v) - { - return col; - } - -#END_FRAGMENT_SHADER -]] - -local shader2 = [[ -#VERTEX_SHADER - - Vertex vert(Vertex v) - { - return v; - } - -#END_VERTEX_SHADER - -#FRAGMENT_SHADER - - Color frag(Color col, Texture tex, Vertex v) - { - if(v.xy.x > 30) - return Color(1, 0, 0, 1); - Color c = texel(tex, v.uv); - return c; - } - -#END_FRAGMENT_SHADER -]] music = nil local tex = nil -local shader_program = nil -local shader_program2 = nil local timer = nil local tb = {x = 1, y = 2} local t = 0 @@ -89,8 +46,6 @@ function jin.core.onLoad() ps:addParticleScalePoint(3, 0) ps:addParticleScalePoint(0, 1) --ps:addParticleSprite(particle_sprite) - shader_program = jin.graphics.newShader(shader) - shader_program2 = jin.graphics.newShader(shader2) local animation = createAnimation("anim2.png", 27, 3, 10, 200, 200, true, 50) animator = jin.graphics.newAnimator(animation) spr = animation:getFrame(1) @@ -134,7 +89,7 @@ function jin.core.onUpdate(dt) end function jin.core.onDraw() - jin.graphics.useShader(shader_program) + jin.graphics.useShader(jin.graphics.Shaders.Shape) jin.graphics.setColor(255, 0, 255, 255) jin.graphics.rect(jin.graphics.RenderMode.FILL, 30, 50, 100, 200) jin.graphics.setColor(255, 255, 255, 255) @@ -144,8 +99,5 @@ function jin.core.onDraw() animator:render(350, 150, 1, 1, 0) jin.graphics.print("* Particle system test\n* Animation test", 10, 10) jin.graphics.draw(spr, 100, 200, 1, 1, 0) - --jin.graphics.useShader(shader_program2) - --jin.graphics.draw(tex, 0, 0,0.2, 0.2) - --jin.graphics.unuseShader() ps:render() end
\ No newline at end of file |