Class: Renderer

(abstract) Renderer(canvas)

Abstract base class for WebGL-based renderers. Provides common WebGL context initialization and management functionality.

Constructor

(abstract) new Renderer(canvas)

Creates a new Renderer instance and initializes the WebGL context.
Parameters:
Name Type Description
canvas HTMLCanvasElement The canvas element to render to.
Source:

Methods

destroy()

Cleans up renderer resources and releases references.
Source:

(abstract) draw()

Performs the rendering operation. Must be implemented by subclasses.
Source:
Throws:
Always throws an error if not implemented.
Type
Error

(abstract) init()

Initializes the renderer. Must be implemented by subclasses.
Source:
Throws:
Always throws an error if not implemented.
Type
Error

onWebGLContextLost(event)

Handles WebGL context lost events and attempts to recover the context.
Parameters:
Name Type Description
event WebGLContextEvent The context lost event.
Source:

(abstract) reset()

Resets the renderer to its initial state. Must be implemented by subclasses.
Source:
Throws:
Always throws an error if not implemented.
Type
Error