Class: RenderContext
Defined in: rendering/render-context.ts:10
The rendering context.
Constructors
Constructor
new RenderContext(
shaderCache,imageCache,canvas,clearStrategy):RenderContext
Defined in: rendering/render-context.ts:41
Constructs a new instance of the RenderContext class.
Parameters
shaderCache
The shader cache.
imageCache
The image cache.
canvas
HTMLCanvasElement
The canvas element.
clearStrategy
CLEAR_STRATEGY_KEYS = CLEAR_STRATEGY.blank
The strategy for clearing the render context (default: CLEAR_STRATEGY.blank).
Returns
RenderContext
Properties
canvas
readonlycanvas:HTMLCanvasElement
Defined in: rendering/render-context.ts:25
The canvas element associated with the render context.
clearStrategy
clearStrategy:
CLEAR_STRATEGY_KEYS
Defined in: rendering/render-context.ts:12
The strategy for clearing the render context.
gl
readonlygl:WebGL2RenderingContext
Defined in: rendering/render-context.ts:28
The WebGL2 rendering context.
imageCache
readonlyimageCache:ImageCache
Defined in: rendering/render-context.ts:22
The image cache containing loaded images.
instanceBuffer
instanceBuffer:
WebGLBuffer
Defined in: rendering/render-context.ts:30
shaderCache
readonlyshaderCache:ShaderCache
Defined in: rendering/render-context.ts:17
The shader store containing compiled shaders.
Methods
getGlobalUniformValue()
getGlobalUniformValue(
name):UniformValue
Defined in: rendering/render-context.ts:85
Parameters
name
string
Returns
resize()
resize(
width,height):void
Defined in: rendering/render-context.ts:68
Resizes the render context canvas and updates the WebGL viewport.
Parameters
width
number
The new canvas width in pixels.
height
number
The new canvas height in pixels.
Returns
void
setGlobalUniformValue()
setGlobalUniformValue(
name,value):void
Defined in: rendering/render-context.ts:80
Parameters
name
string
value
Returns
void