GLResourceManager

Manages Framebuffers and other resources for a GLContext so that the objects can be re-used.

Constructor

new L3D.GLResourceManager(gl)

Parameters
gl GLContext

Methods

getBlitShader()

Shader used for drawing a framebuffer to the screen.

getFullscreenMesh()GLMesh

Returns a GLMesh to render a fullscreen quad.

Returns
GLMesh

releaseFramebuffer(frameBuffer)

Release a framebuffer object so that it can be re-used.

Parameters
frameBuffer GLFramebuffer

releaseFramebufferTexture(texture)

Release the Framebuffer object that uses the given texture as its colorBuffer.

Parameters
texture GLTexture

requestFramebuffer(width, height)GLFramebuffer

Request a framebuffer object with the given dimensions. If a FBO had been previously created and released with the same dimensions, then it will be re-used.

Parameters
width number

The width of the requested framebuffer

height number

The height of the requested framebuffer

Returns
GLFramebuffer