Functions for writing into Error.log or Benchmark.log
Example:
see Log.LogBenchmark for example
Writes the time used from Log.BenchmarkStart(Number) to Log.BenchmarkEnd(Number) into the Benchmark.log
Log.BenchmarkStart(10)
-- Do something
Log.BenchmarkEnd(10)
Log.LogBenchmark("Loading Textures", 10)
--[[ in the Benchmark.log there is now a line like
Loading Textures: 30 miliseconds
--]]
Functions for drawing with OpenGL
gl.Enable("GL_BLEND")
gl.Color(1, 1, 1, 0.1)
for i = 1,10 do
gl.Begin("GL_LINE_LOOP")
gl.Vertex(0+2*i, 0+2*i)
gl.Vertex(0+2*i, 600-2*i)
gl.Vertex(800-2*i, 600-2*i)
gl.Vertex(800-2*i, 0+2*i)
gl.End()
end
gl.Disable("GL_BLEND")
gl.BindTexture("GL_GL_TEXTURE_2D", Tex.Num)
gl.BlendFunc("GL_SRC_ALPHA", "GL_ONE_MINUS_SRC_ALPHA")
gl.Clear("GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT")
gl.ClearAccum(1.0, 1.0, 1.0, 1.0)
gl.ClearColor(1.0, 1.0, 1.0, 1.0)
col = {1.0,0.5,0.0}
gl.Color(col)
gl.Color(1.0,0.5,0.0)
gl.CullFace("GL_FRONT")
gl.DepthFunc("GL_LEQUAL")
gl.DepthRange(0, 10)
gl.DisableClientState("GL_COLOR_ARRAY")
gl.
gl.EnableClientState("GL_COLOR_ARRAY")
gl.Finish()
gl.Flush()
gl.InitNames()
gl.LoadIdentity()
gl.Ortho(0.0, 800.0, 600.0, 0.0, -1.0, 100.0)
gl.PopClientAttrib()
gl.PopMatrix()
gl.PopName()
gl.PushMatrix()
Sets the rasterposition for pixel operations.
gl.Begin("GL_FRONT")
Draws a Rectangle.
gl.Rect({0+2*i, 0+2*i}, {800-2*i, 600-2*i})
gl.Rect(0, 0, 800, 600)
-- does the same as
gl.Begin("GL_POLYGON")
gl.Vertex(0, 0)
gl.Vertex(0, 600)
gl.Vertex(800, 600)
gl.Vertex(800, 0)
gl.Scale(1, -1, 1)
gl.Translate(1, -1, 1)
vert = {10.0, 100.0, 2.0}
gl.Vertex(vert)
gl.Vertex(10.0, 20.0)
gl.Vertex(100, 20, 10, 1)
...
ari-rivil