Skip to content
tom5454 edited this page Nov 5, 2023 · 2 revisions

GPU3D

A special GPU context capable of drawing 3D scenes. Use the render function to finish drawing the current frame.
Don't forget the sync to send the output buffer to the default GPU context.

glDirLight(x, y, z)

glFrustum(fov, zNear, zFar)

render()

Render the 3D scene into the window buffer.

glVertex(x, y, z)

glTexCoord(u, v)

glPushMatrix()

glBegin([mode])

glColor(color)

glLoadIdentity()

glTranslate(x, y, z)

glPopMatrix()

glEnd()

glDeleteTextures(ids...)

glDisable(id)

glGenTextures([num])

glScale(x, y, z)

glRotate(angle, x, y, z)

glEnable(id)

glBindTexture(id)

glTexImage(image)

sync()

Sync the Window

clear()

getBounds()

getConstants()

Return all constants

local glc = {}
local allConst = { gl.getConstants() }
for i=1,#allConst/2 do
	glc[allConst[i * 2 - 1]] = allConst[i * 2]
end
-- Usage example: glc.GL_TEXTURE_2D

Tom's Peripherals Wiki

Clone this wiki locally