XML Feeds

.

[jitter] Re: jxs shaders in jit.gl.lua?

Wesley Smith wesley.hoke at gmail.com
Sun Feb 3 12:24:24 MST 2008


This is how you use shaders.  You just make a shader object and call
its bind methods.
wes


shader = jit.new("jit.gl.shader", this.drawto)
shader.file = "cc.brcosa.jxs" --shader file to load

function draw()


shader:bind()

gl.Begin("QUADS")
 --top left
gl.TexCoord(0., 1.)
gl.Vertex(-0.5, 0.5, 0.)

--bottom left
gl.TexCoord(0., 0.)
gl.Vertex(-0.5, -0.5, 0.)

--bottom right
gl.TexCoord(1., 0.)
gl.Vertex(0.5, -0.5, 0.)

--top right
gl.TexCoord(1., 1.)
gl.Vertex(0.5, 0.5, 0.)
gl.End()

shader:unbind()

end


More information about the jitter mailing list