lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


You have to do your typical OpenGL stuff.

gl and GL map to cgl


local
function draw()
	gl.MatrixMode(GL.PROJECTION)
		gl.PushMatrix()
		gl.LoadIdentity()
		glu.Perspective(45, 1, 1, 100)
	
	gl.MatrixMode(GL.MODELVIEW)
		gl.PushMatrix()
		gl.LoadIdentity()
		gl.Translate(0, 0, -4)

	gl.Color(1, 1, 1, 1)
	gl.Begin(GL.LINES)
		gl.Vertex(-1, 1, 0)
		gl.Vertex(1, 1, 0)
	gl.End()
	
	gl.PointSize(10)
	gl.Begin(GL.POINTS)
		gl.Vertex(-1, 1, 0)
		gl.Vertex(1, 1, 0)
	gl.End()
	
	gl.MatrixMode(GL.PROJECTION)
		gl.PopMatrix()
	
	gl.MatrixMode(GL.MODELVIEW)
		gl.PopMatrix()
end