LuaCommands.odt

(17 KB) Pobierz

Log

Functions for writing into Error.log or Benchmark.log

 

Log.LogError(Message [, Context])

Log.LogMsg(Message, Level [, Context])

Log.BenchmarkStart(Number)

Example:

see Log.LogBenchmark for example

 

Log.BenchmarkEnd(Number)

Example:

see Log.LogBenchmark for example

 

Log.LogBenchmark(Text, Number)

Writes the time used from Log.BenchmarkStart(Number) to Log.BenchmarkEnd(Number) into the Benchmark.log

Example:

  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

  --]]

 

Log.LogDebug(Msg, Context)

Log.LogInfo(Msg, Context)

Log.LogStatus(Msg, Context)

Log.LogWarn(Msg, Context)

Log.LogCritical(Msg, Context)

Log.CriticalError(Text)

Log.SetLogLevel(Level)

Log.GetLogLevel()    : integer

 

gl

Functions for drawing with OpenGL

 

Example:

  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.Begin(EnumString)

Example:

  gl.Begin("GL_LINE_LOOP")

 

gl.BindTexture(EnumString, Texturenumber)

Example:

  gl.BindTexture("GL_GL_TEXTURE_2D", Tex.Num)

 

gl.BlendFunc(EnumString, EnumString)

Example:

  gl.BlendFunc("GL_SRC_ALPHA", "GL_ONE_MINUS_SRC_ALPHA")

 

gl.Clear(EnumStringField)

Example:

  gl.Clear("GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT")

 

gl.ClearAccum(R, G, B, A)

Example:

  gl.ClearAccum(1.0, 1.0, 1.0, 1.0)

 

gl.ClearColor(R, G, B, A)

Example:

  gl.ClearColor(1.0, 1.0, 1.0, 1.0)

 

gl.Color(ColorArray)

Example:

  col = {1.0,0.5,0.0}

  gl.Color(col)

 

gl.Color(R, G, B [, A])

Example:

  gl.Color(1.0,0.5,0.0)

 

gl.CullFace(EnumString)

Example:

  gl.CullFace("GL_FRONT")

 

gl.DepthFunc(EnumString)

Example:

  gl.DepthFunc("GL_LEQUAL")

 

gl.DepthRange(Near, Far)

Example:

  gl.DepthRange(0, 10)

 

gl.Disable(EnumString)

Example:

  gl.Disable("GL_BLEND")

 

gl.DisableClientState(EnumString)

Example:

  gl.DisableClientState("GL_COLOR_ARRAY")

 

gl.DrawBuffer(EnumString)

Example:

  gl.

 

gl.Enable(EnumString)

Example:

  gl.Enable("GL_BLEND")

 

gl.EnableClientState(EnumString)

Example:

  gl.EnableClientState("GL_COLOR_ARRAY")

 

gl.End()

Example:

  gl.End()

 

gl.EndList()

Example:

  gl.End()

 

gl.Finish()

Example:

  gl.Finish()

 

gl.Flush()

Example:

  gl.Flush()

 

gl.FrontFace(EnumString)

Example:

  gl.

 

gl.InitNames()

Example:

  gl.InitNames()

 

gl.LoadIdentity()

Example:

  gl.LoadIdentity()

 

gl.LogicOp(EnumString)

Example:

  gl.

 

gl.MatrixMode(EnumString)

Example:

  gl.

 

gl.Ortho(Left, Right, Bottom, Top, Near, Far)

Example:

  gl.Ortho(0.0, 800.0, 600.0, 0.0, -1.0, 100.0)

 

gl.PopAttrib()

Example:

  gl.

 

gl.PopClientAttrib()

Example:

  gl.PopClientAttrib()

 

gl.PopMatrix()

Example:

  gl.PopMatrix()

 

gl.PopName()

Example:

  gl.PopName()

 

gl.PushMatrix()

Example:

  gl.PushMatrix()

 

gl.RasterPos(X, Y[, Z[, W]])

Sets the rasterposition for pixel operations.

Example:

  gl.

 

gl.ReadBuffer(EnumString)

Example:

  gl.Begin("GL_FRONT")

 

gl.Rect(PosArray,PosArray)

Draws a Rectangle.

Example:

  gl.Rect({0+2*i, 0+2*i}, {800-2*i, 600-2*i})

 

gl.Rect(X1, Y1, X2, Y2)

Draws a Rectangle.

Example:

  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.End()

 

gl.Rotate(Angle, X, Y, Z)

Example:

  gl.

 

gl.Scale(X, Y, Z)

Example:

  gl.Scale(1, -1, 1)

 

gl.ShadeModel(EnumString)

Example:

  gl.

 

gl.TexCoord(PosArray)

Example:

  gl.

 

gl.TexCoord(S [, T [, R [, Q]]])

Example:

  gl.

 

gl.Translate(X, Y, Z)

Example:

  gl.Translate(1, -1, 1)

 

gl.Vertex(PosArray)

Example:

  vert = {10.0, 100.0, 2.0}

  gl.Vertex(vert)

 

gl.Vertex(X, Y [, Z [, W]])

Example:

  gl.Vertex(10.0, 20.0)

  gl.Vertex(100, 20, 10, 1)

...

Zgłoś jeśli naruszono regulamin