Class vxlEngine

Defines the behaviour of a rendering engine

Constructor

Methods

.allocate(scene)
Allocates resources for rendering

Parameters:

Type Name Description
vxlScene scene

the scene to be rendered

.clear()
Clears the GL context between rendering calls
.clearColor(r, g, b)
Sets the color used to clear the canvas

Parameters:

Type Name Description
Number|Array|vec3 r

it can be the red component, a 3-dimensional Array or a vec3 (glMatrix)

Number g

if r is a number, then this parameter corresponds to the green component

Number b

if r is a number, then this parameter corresponds to the blue component

See:

vxlView#setBackgroundColor
.clearDepth(d)
Sets the clear depth

Parameters:

Type Name Description
Number d

the new clear depth

.configure()
Initial configuration of the engine
.deallocate(scene)
Deallocates resources after rendering

Parameters:

Type Name Description
vxlScene scene

the scene that was just rendered

.disableOffscreen()
Disables offscreen rendering
.enableOffscreen()
Enables offscreen rendering
.init(p_renderer)
Initializes the engine

Parameters:

Type Name Description
Object p_renderer

the renderer using this instance of the engine

.isOffscreenEnabled()
Queries whether or not the offscreen rendering is enabled
.readOffscreenPixel(x, y)
If the offscreen rendering is enabled, returns the pixel value from the offscreen renderbuffer

Parameters:

Type Name Description
x

y

.reallocate(scene)
Invoked when a resource needs to be reallocated between rendering cycles

Parameters:

Type Name Description
vxlScene scene

the scene containing the resource

.releaseProgram()
.render(scene)
Renders a scene

Parameters:

Type Name Description
vxlScene scene

the scene to be rendered

.setProgram(p_program, p_force_it)
Sets the vxlProgram that this engine will use

Parameters:

Type Name Description
Object p_program

Object p_force_it