Functions

Texture:allocate(components, type, ...) Allocate internal texture data
Texture.array() Get the Texture's internal Array
Texture.autoclear GETSET Flag for clearing Texture on startcapture()
Texture:bind([unit]) Bind a texture to a texture unit
Texture.bordercolor GETSET OpenGL Texture border color
Texture:clear() Clear the texture
Texture.clearcolor GETSET OpenGL Clear color
Texture.cleardepth GETSET OpenGL Depth clear value
Texture:copy(tex) Copy a Texture
Texture.dim GETSET Dimensions
Texture:endcapture() End rendering to the Texture
Texture.format GETSET OpenGL Texture format
Texture:fromarray([offset], array) Send a array to the GPU
Texture.magfilter GETSET OpenGL Texture magnification filter
Texture.minfilter GETSET OpenGL Texture minification filter
Texture.single_channel GETSET OpenGL Texture format for single channel images
Texture:startcapture() Start rendering to the Texture
Texture.target GETSET OpenGL Texture target
Texture.texid GET OpenGL Texture ID
Texture:toarray() Grab the Texture data from the GPU and store it in the Texture's Array
Texture.type GETSET OpenGL Texture type
Texture:unbind([unit]) Unbind a texture from a texture unit
Texture.wrap GETSET OpenGL Texture wrap mode

Functions

Texture:allocate(components, type, ...)

Allocate internal texture data

Parameters:

components The number of components
type The data type
... The x, y, z dimensions as a table or unpacked
Texture.array()

Get the Texture's internal Array

Return:

  • The array
Texture.autoclear GETSET

Flag for clearing Texture on startcapture()

Texture:bind([unit])

Bind a texture to a texture unit

Parameters:

[unit] The index of the texture unit (default is 0)
Texture.bordercolor GETSET

The RGBA values as a table

Texture:clear()

Clear the texture

Texture.clearcolor GETSET

The RGBA values as a table

Texture.cleardepth GETSET

The depth value on clear

Texture:copy(tex)

Copy a Texture

Parameters:

tex The Texture to copy
Texture.dim GETSET

Dimensions

Texture:endcapture()

End rendering to the Texture

Texture.format GETSET

Possible formats GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, or GL_DEPTH_COMPONENT

Texture:fromarray([offset], array)

Send a array to the GPU

Parameters:

[offset] The offset into the internal texture buffer
array The array
Texture.magfilter GETSET

Possible magfilters GL_NEAREST or GL_LINEAR

Texture.minfilter GETSET

Possible minfilters GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR

Texture.single_channel GETSET

Possible formats GL_ALPHA, GL_LUMINANCE

Texture:startcapture()

Start rendering to the Texture

Texture.target GETSET

Possible targets GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB, or GL_TEXTURE_3D

Texture.texid GET

OpenGL Texture ID

Texture:toarray()

Grab the Texture data from the GPU and store it in the Texture's Array

Texture.type GETSET

Possible types type GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, and GL_FLOAT

Texture:unbind([unit])

Unbind a texture from a texture unit

Parameters:

[unit] The index of the texture unit (default is 0)
Texture.wrap GETSET

Possible wrap modesGL_CLAMP_TO_EDGE, GL_CLAMP, GL_CLAMP_TO_BORDER, GL_MIRRORED_REPEAT (2D only), or GL_REPEAT (2D only)