The OpenGL bindings for jit.gl.lua are found in the module, which is built-in to the object. To access the bindings, simpply use the built-in Lua function, , to load the module as follows:
-- load in the module and set some aliases
local gl = require("opengl")
local GL = gl
The idiom above allows us to write code that more closely resembles C-style OpenGL code. For the OpenGL Utility (GLU) functions see the For the standard OpenGL bindings, see the jit.gl.lua OpenGL GLU Bindings.
Accum(op, value)
Operate on the accumulation buffer
OpenGL Documentation: glAccum
- Specifies the accumulation buffer operation. Symbolic constants GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN are accepted.
- Specifies a floating-point value used in the accumulation buffer operation. op determines how value is used.
AlphaFunc(func, ref)
Specify the alpha test function
OpenGL Documentation: glAlphaFunc
- Specifies the alpha comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, and GL_ALWAYS are accepted. The initial value is GL_ALWAYS
- Specifies the reference value that incoming alpha values are compared to. This value is clamped to the range 0 1 , where 0 represents the lowest possible alpha value and 1 the highest possible value. The initial reference value is 0
Begin(mode)
Delimit the vertices of a primitive or a group of like primitives
OpenGL Documentation: glBegin
- Specifies the primitive or primitives that will be created from vertices presented between glBegin and the subsequent glEnd. Ten symbolic constants are accepted: GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, and GL_POLYGON.
BlendFunc(sfactor, dfactor)
Specify pixel arithmetic
OpenGL Documentation: glBlendFunc
- Specifies how the red, green, blue, and alpha source blending factors are computed. The following symbolic constants are accepted: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, and GL_SRC_ALPHA_SATURATE. The initial value is GL_ONE.
- Specifies how the red, green, blue, and alpha destination blending factors are computed. The same constants are accepted as for sfactor.
CallList(list)
Execute a display list
OpenGL Documentation: glCallList
- Specifies the integer name of the display list to be executed.
Clear(mask)
Clear buffers to preset values
OpenGL Documentation: glClear
- Bitwise OR of masks that indicate the buffers to be cleared. The four masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT.
ClearAccum(...)
Specify clear values for the accumulation buffer
OpenGL Documentation: glClearAccum
- Either a 4 numbers or a table specifying the red, green, blue, and alpha values used when the accumulation buffer is cleared. The initial values are all 0.
ClearColor(...)
Specify clear values for the color buffers
OpenGL Documentation: glClearColor
- Either a 4 numbers or a table specifying the red, green, blue, and alpha values used when the color buffers are cleared. The initial values are all 0.
ClearDepth(depth)
Specify the clear value for the depth buffer
OpenGL Documentation: glClearDepth
- Specifies the depth value used when the depth buffer is cleared. The initial value is 1.
ClearIndex(c)
Specify the clear value for the color index buffers
OpenGL Documentation: glClearIndex
- Specifies the index used when the color index buffers are cleared. The initial value is 0.
ClearStencil(c)
Specify the clear value for the stencil buffer
OpenGL Documentation: glClearStencil
- Specifies the index used when the stencil buffer is cleared. The initial value is 0.
ClipPlane(plane, equation)
Specify a plane against which all geometry is clipped
OpenGL Documentation: glClipPlane
- Specifies which clipping plane is being positioned. Symbolic names of the form GL_CLIP_PLANEi, where i is an integer between 0 and GL_MAX_CLIP_PLANES -1 , are accepted.
- Specifies the address of an array of four double-precision floating-point values. These values are interpreted as a plane equation.
Color(...)
Set the current color
OpenGL Documentation: glColor
- Specify either 3 or 4 numbers or a table for new red, green, blue and [alpha] values for the current color. The default value is (0, 0, 0, 1).
ColorMask(...)
Enable and disable writing of frame buffer color components
OpenGL Documentation: glColorMask
- Either 4 numbers or a table specifying whether red, green, blue, and alpha can or cannot be written into the frame buffer. The initial values are all GL_TRUE, indicating that the color components can be written.
ColorMaterial(face, mode)
Cause a material color to track the current color
OpenGL Documentation: glColorMaterial
- Specifies whether front, back, or both front and back material parameters should track the current color. Accepted values are GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK. The initial value is GL_FRONT_AND_BACK.
- Specifies which of several material parameters track the current color. Accepted values are GL_EMISSION, GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, and GL_AMBIENT_AND_DIFFUSE. The initial value is GL_AMBIENT_AND_DIFFUSE.
CopyPixels(x, y, width, height, type)
Copy pixels in the frame buffer
OpenGL Documentation: glCopyPixels
- Specify the x window coordinate of the lower left corner of the rectangular region of pixels to be copied.
- Specify the y window coordinate of the lower left corner of the rectangular region of pixels to be copied.
- Specify the horizontal dimensions of the rectangular region of pixels to be copied. Both must be nonnegative.
- Specify the vertical dimensions of the rectangular region of pixels to be copied. Both must be nonnegative.
- Specifies whether color values, depth values, or stencil values are to be copied. Symbolic constants GL_COLOR, GL_DEPTH, and GL_STENCIL are accepted.
CopyTexImage(target, level, internalformat, x, y, width, [height], border)
Copy pixels into a 1D or 2D texture image
If no height argument is given, glCopyTexImage1D will be used, otherwise, glCopyTexImage2D be used. Example usage:
OpenGL Documentation: glCopyTexImage1D, glCopyTexImage2D
- Only relevant in the 2D case. Specifies the target texture. Must be GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.
- Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
- Specifies the internal format of the texture. See OpenGL documentation for accepted values.
- Specify the x window coordinate of the left corner of the row of pixels to be copied.
- Specify the y window coordinate of the left corner of the row of pixels to be copied.
- Specifies the width of the texture image. Must be 0 or 2 n + 2 border for some integer n.
- Specifies the height of the texture image. Must be 0 or 2 m + 2 border for some integer m. The height of the texture image in the 1D case is 1.
- Specifies the width of the border. Must be either 0 or 1.
CopyTexSubImage(target, level, xoffset, [yoffset], x, y, width, [height])
Copy a 1D or 2D texture subimage
If no yoffset or height argument is given, glCopyTexSubImage1D will be used, otherwise, glCopyTexSubImage2D be used. Example usage:
OpenGL Documentation: glCopyTexSubImage1D, glCopyTexSubImage2D
- Only relevant in the 2D case. Specifies the target texture. Must be GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z.
- Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
- Specifies a texel offset in the x direction within the texture array..
- Specifies a texel offset in the y direction within the texture array..
- Specify the x window coordinate of the left corner of the row of pixels to be copied.
- Specify the y window coordinate of the left corner of the row of pixels to be copied.
- Specifies the width of the texture subimage.
- Specifies the height of the texture subimage.
CullFace(mode)
Specify whether front- or back-facing facets can be culled
OpenGL Documentation: glCullFace
- Specifies whether front- or back-facing facets are candidates for culling. Symbolic constants GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK are accepted. The initial value is GL_BACK.
DeleteLists(list, range)
Delete a contiguous group of display lists
OpenGL Documentation: glDeleteLists
- Specifies the integer name of the first display list to delete.
- Specifies the number of display lists to delete.
DepthFunc(func)
Specify the value used for depth buffer comparisons
OpenGL Documentation: glDepthFunc
- Specifies the depth comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, and GL_ALWAYS are accepted. The initial value is GL_LESS.
DepthMask(flag)
Enable or disable writing into the depth buffer
OpenGL Documentation: glDepthMask
- Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled.
DepthRange(near, far)
Specify mapping of depth values from normalized device coordinates to window coordinates
OpenGL Documentation: glDepthRange
- Specifies the mapping of the near clipping plane to window coordinates. The initial value is 0.
- Specifies the mapping of the far clipping plane to window coordinates. The initial value is 1.
Disable(cap)
Disable server-side GL capabilities
OpenGL Documentation: glDisable
- Specifies a symbolic constant indicating a GL capability.
DrawBuffer(mode)
Specify which color buffers are to be drawn into
OpenGL Documentation: glDrawBuffer
- Specifies up to four color buffers to be drawn into. Symbolic constants GL_NONE, GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT, GL_FRONT_AND_BACK, and GL_AUXi, where i is between 0 and the value of GL_AUX_BUFFERS minus 1, are accepted. (GL_AUX_BUFFERS is not the upper limit; use glGet to query the number of available aux buffers.) The initial value is GL_FRONT for single-buffered contexts, and GL_BACK for double-buffered contexts
EdgeFlag(flag)
Flag edges as either boundary or nonboundary
OpenGL Documentation: glEdgeFlag
- Specifies the current edge flag value, either GL_TRUE or GL_FALSE. The initial value is GL_TRUE.
Enable(cap)
Enable server-side GL capabilities
OpenGL Documentation: glEnable
- Specifies a symbolic constant indicating a GL capability.
End()
Delimit the vertices of a primitive or a group of like primitives
OpenGL Documentation: glEnd
EndList()
End the creation or replacement of a display list
OpenGL Documentation: glEndList
Finish()
Block until all GL execution is complete
OpenGL Documentation: glFinish
Flush()
Force execution of GL commands in finite time
OpenGL Documentation: glFlush
Fog(pname, ...)
Specify fog parameters
OpenGL Documentation: glFog
- Specifies a single-valued fog parameter. GL_FOG_MODE, GL_FOG_DENSITY, GL_FOG_START, GL_FOG_END, GL_FOG_INDEX, and GL_FOG_COORD_SRC are accepted.
- Specifies the value that pname will be set to.
FrontFace(mode)
Define front- and back-facing polygons
OpenGL Documentation: glFrontFace
- Specifies the orientation of front-facing polygons. GL_CW and GL_CCW are accepted. The initial value is GL_CCW.
Frustum(left, right, bottom, top, near, far)
Multiply the current matrix by a perspective matrix
OpenGL Documentation: glFrustum
- Specify the coordinates for the left vertical clipping plane.
- Specify the coordinates for the right vertical clipping plane.
- Specify the coordinates for the top horizontal clipping plane.
- Specify the coordinates for the bottom horizontal clipping plane.
- Specify the distance to the near depth clipping plane. Must be positive.
- Specify the distance to the far depth clipping plane. Must be positive.
GenLists(range)
Generate a contiguous set of empty display lists
OpenGL Documentation: glGenLists
- Specifies the number of contiguous empty display lists to be generated.
Get(pname)
Return the value or values of a selected parameter
OpenGL Documentation: glGet
- Specifies the parameter value to be returned. See documentation for the list of accepted values.
GetClipPlane(plane)
Return the coefficients of the specified clipping plane
OpenGL Documentation: glGetClipPlane
- Specifies a clipping plane. The number of clipping planes depends on the implementation, but at least six clipping planes are supported. They are identified by symbolic names of the form GL_CLIP_PLANE i where i ranges from 0 to the value of GL_MAX_CLIP_PLANES - 1.
GetError()
Return error information
OpenGL Documentation: glGetError
GetLight(light, pname)
Return light source parameter values
OpenGL Documentation: glGetLight
- Specifies a light source. The number of possible lights depends on the implementation, but at least eight lights are supported. They are identified by symbolic names of the form GL_LIGHTi where i ranges from 0 to the value of GL_MAX_LIGHTS - 1.
- Specifies a light source parameter for light. Accepted symbolic names are GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION, GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and GL_QUADRATIC_ATTENUATION.
GetMaterial(target, pname)
Return material parameters
OpenGL Documentation: glGetMaterial
- Specifies which of the two materials is being queried. GL_FRONT or GL_BACK are accepted, representing the front and back materials, respectively.
- Specifies the material parameter to return. GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, and GL_COLOR_INDEXES are accepted.
GetString(name)
Return a string describing the current GL connection
OpenGL Documentation: glGetString
- Specifies a symbolic constant, one of GL_VENDOR, GL_RENDERER, GL_VERSION, GL_SHADING_LANGUAGE_VERSION, or GL_EXTENSIONS.
GetTexEnv(target, pname)
Return texture environment parameters
OpenGL Documentation: glGetTexEnv
- Specifies a texture environment. May be GL_TEXTURE_ENV, GL_TEXTURE_FILTER_CONTROL, or GL_POINT_SPRITE.
- Specifies the symbolic name of a texture environment parameter. Accepted values are GL_TEXTURE_ENV_MODE, GL_TEXTURE_ENV_COLOR, GL_TEXTURE_LOD_BIAS, GL_COMBINE_RGB, GL_COMBINE_ALPHA, GL_SRC0_RGB, GL_SRC1_RGB, GL_SRC2_RGB, GL_SRC0_ALPHA, GL_SRC1_ALPHA, GL_SRC2_ALPHA, GL_OPERAND0_RGB, GL_OPERAND1_RGB, GL_OPERAND2_RGB, GL_OPERAND0_ALPHA, GL_OPERAND1_ALPHA, GL_OPERAND2_ALPHA, GL_RGB_SCALE, GL_ALPHA_SCALE, or GL_COORD_REPLACE.
GetTexGen(coord, pname)
Return texture coordinate generation parameters
OpenGL Documentation: glGetTexGen
- Specifies a texture coordinate. Must be GL_S, GL_T, GL_R, or GL_Q.
- Specifies the symbolic name of the value(s) to be returned. Must be either GL_TEXTURE_GEN_MODE or the name of one of the texture generation plane equations: GL_OBJECT_PLANE or GL_EYE_PLANE.
GetTexLevelParameter(target, level, pname)
Return texture parameter values for a specific level of detail
OpenGL Documentation: glGetTexLevelParameter
- Specifies the symbolic name of the target texture, either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D, GL_PROXY_TEXTURE_3D, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or GL_PROXY_TEXTURE_CUBE_MAP.
- Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level n is the nth mipmap reduction image.
- Specifies the symbolic name of a texture parameter. GL_TEXTURE_WIDTH, GL_TEXTURE_HEIGHT, GL_TEXTURE_DEPTH, GL_TEXTURE_INTERNAL_FORMAT, GL_TEXTURE_BORDER, GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE, GL_TEXTURE_LUMINANCE_SIZE, GL_TEXTURE_INTENSITY_SIZE, GL_TEXTURE_DEPTH_SIZE, GL_TEXTURE_COMPRESSED, and GL_TEXTURE_COMPRESSED_IMAGE_SIZE are accepted.
GetTexParameter(target, pname)
Return texture parameter values
OpenGL Documentation: glGetTexParameter
- Specifies the symbolic name of the target texture. GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, and GL_TEXTURE_CUBE_MAP are accepted.
- Specifies the symbolic name of a texture parameter. GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TEXTURE_WRAP_R, GL_TEXTURE_BORDER_COLOR, GL_TEXTURE_PRIORITY, GL_TEXTURE_RESIDENT, GL_TEXTURE_COMPARE_MODE, GL_TEXTURE_COMPARE_FUNC, GL_DEPTH_TEXTURE_MODE, and GL_GENERATE_MIPMAP are accepted.
Hint(target, mode)
Specify implementation-specific hints
OpenGL Documentation: glHint
- Specifies a symbolic constant indicating the behavior to be controlled. GL_FOG_HINT, GL_GENERATE_MIPMAP_HINT, GL_LINE_SMOOTH_HINT, GL_PERSPECTIVE_CORRECTION_HINT, GL_POINT_SMOOTH_HINT, GL_POLYGON_SMOOTH_HINT, GL_TEXTURE_COMPRESSION_HINT, and GL_FRAGMENT_SHADER_DERIVATIVE_HINT are accepted.
- Specifies a symbolic constant indicating the desired behavior. GL_FASTEST, GL_NICEST, and GL_DONT_CARE are accepted.
Index(c)
Set the current color index
OpenGL Documentation: glIndex
- Specifies the new value for the current color index.
IndexMask(mask)
Control the writing of individual bits in the color index buffers
OpenGL Documentation: glIndexMask
- Specifies a bit mask to enable and disable the writing of individual bits in the color index buffers. Initially, the mask is all 1's.
InitNames()
Initialize the name stack
OpenGL Documentation: glInitNames
IsEnabled(cap)
Test whether a capability is enabled
OpenGL Documentation: glIsEnabled
- Specifies a symbolic constant indicating a GL capability.
IsList(list)
Determine if a name corresponds to a display list
OpenGL Documentation: glIsList
- Specifies a symbolic constant indicating a GL capability.
IsTexture(texture)
Determine if a name corresponds to a texture
OpenGL Documentation: glIsTexture
- Specifies a value that may be the name of a texture.
Light(light, pname, params)
Set light source parameters
OpenGL Documentation: glLight
- Specifies a light. The number of lights depends on the implementation, but at least eight lights are supported. They are identified by symbolic names of the form GL_LIGHTi, where i ranges from 0 to the value of GL_MAX_LIGHTS - 1.
- Specifies a light source parameter for light. GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION, GL_SPOT_CUTOFF, GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and GL_QUADRATIC_ATTENUATION are accepted.
- Specifies the value that parameter pname of light source light will be set to.
LightModel(pname, params)
Set the lighting model parameters
OpenGL Documentation: glLightModel
- Specifies a single-valued lighting model parameter. GL_LIGHT_MODEL_LOCAL_VIEWER, GL_LIGHT_MODEL_COLOR_CONTROL, and GL_LIGHT_MODEL_TWO_SIDE are accepted.
- Specifies the value that param will be set to.
LineStipple(factor, pattern)
Specify the line stipple pattern
OpenGL Documentation: glLineStipple
- Specifies a multiplier for each bit in the line stipple pattern. If factor is 3, for example, each bit in the pattern is used three times before the next bit in the pattern is used. factor is clamped to the range [1, 256] and defaults to 1.
- Specifies a 16-bit integer whose bit pattern determines which fragments of a line will be drawn when the line is rasterized. Bit zero is used first; the default pattern is all 1's.
LineWidth(width)
Specify the width of rasterized lines
OpenGL Documentation: glLineWidth
- Specifies the width of rasterized lines. The initial value is 1.
ListBase(base)
Set the display-list base for glCallLists
OpenGL Documentation: glListBase
- Specifies an integer offset that will be added to glCallLists offsets to generate display-list names. The initial value is 0.
LoadIdentity()
Replace the current matrix with the identity matrix
OpenGL Documentation: glLoadIdentity
LoadMatrix(m)
Replace the current matrix with the specified matrix
OpenGL Documentation: glLoadMatrix
- Specifies 16 consecutive values, which are used as the elements of a 4×4 column-major matrix.
LoadName(name)
Load a name onto the name stack
OpenGL Documentation: glLoadName
- Specifies a name that will replace the top value on the name stack.
LogicOp(opcode)
Specify a logical pixel operation for color index rendering
OpenGL Documentation: glLogicOp
- Specifies a symbolic constant that selects a logical operation. The following symbols are accepted: GL_CLEAR, GL_SET, GL_COPY, GL_COPY_INVERTED, GL_NOOP, GL_INVERT, GL_AND, GL_NAND, GL_OR, GL_NOR, GL_XOR, GL_EQUIV, GL_AND_REVERSE, GL_AND_INVERTED, GL_OR_REVERSE, and GL_OR_INVERTED. The initial value is GL_COPY.
Material(face, pname, params)
Specify material parameters for the lighting model
OpenGL Documentation: glMaterial
- Specifies which face or faces are being updated. Must be one of GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK.
- Specifies the material parameter of the face or faces that is being updated. Must be one of GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, GL_AMBIENT_AND_DIFFUSE, or GL_COLOR_INDEXES.
- Specifies a pointer to the value or values that pname will be set to.
MatrixMode(mode)
Specify which matrix is the current matrix
OpenGL Documentation: glMatrixMode
- Specifies which matrix stack is the target for subsequent matrix operations. Three values are accepted: GL_MODELVIEW, GL_PROJECTION, and GL_TEXTURE. The initial value is GL_MODELVIEW. Additionally, if the ARB_imaging extension is supported, GL_COLOR is also accepted.
MultMatrix(m)
Multiply the current matrix with the specified matrix
OpenGL Documentation: glMultMatrix
- Specifies 16 consecutive values, which are used as the elements of a 4×4 column-major matrix.
NewList(list, mode)
Create or replace a display list
OpenGL Documentation: glNewList
- Specifies the display-list name.
- Specifies the compilation mode, which can be GL_COMPILE or GL_COMPILE_AND_EXECUTE.
Normal(...)
Set the current normal vector
OpenGL Documentation: glNormal
- Either a 3 numbers or a table specifying the x, y, and z coordinates of the new current normal. The initial value of the current normal is the unit vector, (0, 0, 1).
Ortho(left, right, bottom, top, near, far)
Multiply the current matrix with an orthographic matrix
OpenGL Documentation: glOrtho
- Specify the coordinates for the left vertical clipping plane.
- Specify the coordinates for the right vertical clipping plane.
- Specify the coordinates for the bottom horizontal clipping plane.
- Specify the coordinates for the top horizontal clipping plane.
- Specify the distances to the nearer depth clipping plane. This value is negative if the plane is to be behind the viewer.
- Specify the distances to the farther depth clipping plane. This value is negative if the plane is to be behind the viewer.
PassThrough(token)
Place a marker in the feedback buffer
OpenGL Documentation: glPassThrough
- Specifies a marker value to be placed in the feedback buffer following a GL_PASS_THROUGH_TOKEN.
PixelStore(pname, param)
Set pixel storage modes
OpenGL Documentation: glPixelStore
- Specifies the symbolic name of the parameter to be set. Six values affect the packing of pixel data into memory: GL_PACK_SWAP_BYTES, GL_PACK_LSB_FIRST, GL_PACK_ROW_LENGTH, GL_PACK_IMAGE_HEIGHT, GL_PACK_SKIP_PIXELS, GL_PACK_SKIP_ROWS, GL_PACK_SKIP_IMAGES, and GL_PACK_ALIGNMENT. Six more affect the unpacking of pixel data from memory: GL_UNPACK_SWAP_BYTES, GL_UNPACK_LSB_FIRST, GL_UNPACK_ROW_LENGTH, GL_UNPACK_IMAGE_HEIGHT, GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS, GL_UNPACK_SKIP_IMAGES, and GL_UNPACK_ALIGNMENT.
- Specifies the value that pname is set to.
PixelTransfer(pname, param)
Set pixel transfer modes
OpenGL Documentation: glPixelTransfer
- Specifies the symbolic name of the pixel transfer parameter to be set. Must be one of the following: GL_MAP_COLOR, GL_MAP_STENCIL, GL_INDEX_SHIFT, GL_INDEX_OFFSET, GL_RED_SCALE, GL_RED_BIAS, GL_GREEN_SCALE, GL_GREEN_BIAS, GL_BLUE_SCALE, GL_BLUE_BIAS, GL_ALPHA_SCALE, GL_ALPHA_BIAS, GL_DEPTH_SCALE, or GL_DEPTH_BIAS.
- Specifies the value that pname is set to.
PixelZoom(xfactor, yfactor)
Specify the pixel zoom factors
OpenGL Documentation: glPixelZoom
- Specify the x zoom factor for pixel write operations.
- Specify the y zoom factor for pixel write operations.
PointSize(size)
Specify the diameter of rasterized points
OpenGL Documentation: glPointSize
- Specifies the diameter of rasterized points. The initial value is 1.
PolygonMode(face, mode)
Select a polygon rasterization mode
OpenGL Documentation: glPolygonMode
- Specifies the polygons that mode applies to. Must be GL_FRONT for front-facing polygons, GL_BACK for back-facing polygons, or GL_FRONT_AND_BACK for front- and back-facing polygons.
- Specifies how polygons will be rasterized. Accepted values are GL_POINT, GL_LINE, and GL_FILL. The initial value is GL_FILL for both front- and back-facing polygons.
PolygonOffset(factor, units)
Set the scale and units used to calculate depth values
OpenGL Documentation: glPolygonOffset
- Specifies a scale factor that is used to create a variable depth offset for each polygon. The initial value is 0.
- Is multiplied by an implementation-specific value to create a constant depth offset. The initial value is 0.
PopAttrib()
Pop the server attribute stack
OpenGL Documentation: glPopAttrib
PopClientAttrib()
Pop the client attribute stack
OpenGL Documentation: glPopClientAttrib
PopMatrix()
Pop the current matrix stack
OpenGL Documentation: glPopMatrix
PopName()
Pop the name stack
OpenGL Documentation: glPopName
PushAttrib(mask)
Push the server attribute stack
OpenGL Documentation: glPushAttrib
- Specifies a mask that indicates which attributes to save.
PushClientAttrib()
Push the client attribute stack
OpenGL Documentation: glPushClientAttrib
PushMatrix()
Push the current matrix stack
OpenGL Documentation: glPushMatrix
PushName(name)
Push the name stack
OpenGL Documentation: glPushName
- Specifies a name that will be pushed onto the name stack.
RasterPos(..)
Specify the raster position for pixel operations
OpenGL Documentation: glRasterPos
- Specifies an array or list of values of two, three, or four elements, specifying x, y, z, and w coordinates, respectively.
ReadBuffer(mode)
Select a color buffer source for pixels
OpenGL Documentation: glReadBuffer
- Specifies a color buffer. Accepted values are GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT, and GL_AUXi, where i is between 0 and the value of GL_AUX_BUFFERS minus 1.
Rect(...)
Draw a rectangle
OpenGL Documentation: glRect
- Specify the vertices of a rectangle as an array or list of 4 values.
RenderMode(mode)
Set rasterization mode
OpenGL Documentation: glRenderMode
- Specifies the rasterization mode. Three values are accepted: GL_RENDER, GL_SELECT, and GL_FEEDBACK. The initial value is GL_RENDER.
Rotate(...)
Multiply the current matrix by a rotation matrix
OpenGL Documentation: glRotate
- Specify an array or list of 4 values with the order being the angle of rotation in degrees and then the the x, y, and z coordinates of a vector, respectively
Scale(...)
Multiply the current matrix by a general scaling matrix
OpenGL Documentation: glScale
- Specify an array or list of 3 values of scale factors along the x, y, and z axes, respectively
Scissor(x, y, width, height)
Define the scissor box
OpenGL Documentation: glScissor
- Specify the x-coordinate of the lower left corner of the scissor box.
- Specify the y-coordinate of the lower left corner of the scissor box.
- Specify the width of the scissor box.
- Specify the height of the scissor box.
ShadeModel(mode)
Select flat or smooth shading
OpenGL Documentation: glShadeModel
- Specifies a symbolic value representing a shading technique. Accepted values are GL_FLAT and GL_SMOOTH. The initial value is GL_SMOOTH.
StencilFunc(func, ref, mask)
Set front and back function and reference value for stencil testing
OpenGL Documentation: glStencilFunc
- Specifies the test function. Eight symbolic constants are valid: GL_NEVER, GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL, GL_EQUAL, GL_NOTEQUAL, and GL_ALWAYS. The initial value is GL_ALWAYS.
- Specifies the reference value for the stencil test. ref is clamped to the range 0 2 n-1 , where n is the number of bitplanes in the stencil buffer. The initial value is 0.
- Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is all 1's.
StencilMask(mask)
Control the front and back writing of individual bits in the stencil planes
OpenGL Documentation: glStencilMask
- Specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all 1's.
StencilOp(sfail, dpfail, dppass)
Set front and back stencil test actions
OpenGL Documentation: glStencilOp
- Specifies the action to take when the stencil test fails. Eight symbolic constants are accepted: GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_INCR_WRAP, GL_DECR, GL_DECR_WRAP, and GL_INVERT. The initial value is GL_KEEP.
- Specifies the stencil action when the stencil test passes, but the depth test fails. dpfail accepts the same symbolic constants as sfail. The initial value is GL_KEEP.
- Specifies the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. dppass accepts the same symbolic constants as sfail. The initial value is GL_KEEP.
TexCoord(..)
Set the current texture coordinates
OpenGL Documentation: glTexCoord
- Specifies an array or list of one, two, three, or four elements, which in turn specify the s, t, r, and q texture coordinates.
TexEnv(target, pname, param)
Set texture environment parameters
OpenGL Documentation: glTexEnv
- Specifies a texture environment. May be GL_TEXTURE_ENV, GL_TEXTURE_FILTER_CONTROL or GL_POINT_SPRITE.
- Specifies the symbolic name of a single-valued texture environment parameter. May be either GL_TEXTURE_ENV_MODE, GL_TEXTURE_LOD_BIAS, GL_COMBINE_RGB, GL_COMBINE_ALPHA, GL_SRC0_RGB, GL_SRC1_RGB, GL_SRC2_RGB, GL_SRC0_ALPHA, GL_SRC1_ALPHA, GL_SRC2_ALPHA, GL_OPERAND0_RGB, GL_OPERAND1_RGB, GL_OPERAND2_RGB, GL_OPERAND0_ALPHA, GL_OPERAND1_ALPHA, GL_OPERAND2_ALPHA, GL_RGB_SCALE, GL_ALPHA_SCALE, or GL_COORD_REPLACE.
- Specifies a single symbolic constant, one of GL_ADD, GL_ADD_SIGNED, GL_INTERPOLATE, GL_MODULATE, GL_DECAL, GL_BLEND, GL_REPLACE, GL_SUBTRACT, GL_COMBINE, GL_TEXTURE, GL_CONSTANT, GL_PRIMARY_COLOR, GL_PREVIOUS, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, a single boolean value for the point sprite texture coordinate replacement, a single floating-point value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0 when specifying the GL_RGB_SCALE or GL_ALPHA_SCALE.
TexGen(coord, pname, param)
Control the generation of texture coordinates
OpenGL Documentation: glTexGen
- Specifies a texture coordinate. Must be one of GL_S, GL_T, GL_R, or GL_Q.
- Specifies the symbolic name of the texture-coordinate generation function. Must be GL_TEXTURE_GEN_MODE.
- Specifies a single-valued texture generation parameter, one of GL_OBJECT_LINEAR, GL_EYE_LINEAR, GL_SPHERE_MAP, GL_NORMAL_MAP, or GL_REFLECTION_MAP.
TexParameter(target, pname, param)
Set texture parameters
OpenGL Documentation: glTexParameter
- Specifies the target texture, which must be either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_CUBE_MAP.
- Specifies the symbolic name of a single-valued texture parameter. pname can be one of the following: GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TEXTURE_WRAP_R, GL_TEXTURE_PRIORITY, GL_TEXTURE_COMPARE_MODE, GL_TEXTURE_COMPARE_FUNC, GL_DEPTH_TEXTURE_MODE, or GL_GENERATE_MIPMAP.
- Specifies the value of pname.
Translate(...)
Multiply the current matrix by a translation matrix
OpenGL Documentation: glTranslate
- Specify an array or list of 3 values of translation vector
Vertex(..)
Specify a vertex
OpenGL Documentation: glVertex
- Specifies an array or list of two, three, or four elements, which in turn specify the x, y, z, and w vertex coordinates.
Viewport(x, y, width, height)
Set the viewport
OpenGL Documentation: glViewport
- Specify the x-coordinate of the lower left corner of the viewport rectangle.
- Specify the y-coordinate of the lower left corner of the viewport rectangle.
- Specify the width of the viewport rectangle.
- Specify the height of the viewport rectangle.
See Also
Name | Description |
---|---|
Working with OpenGL | Working with OpenGL |
Lua in Max | Lua in Max |