API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classWebGl2Backend
WebGL 2.0 implementation of RenderBackend. Manages the GL context, texture and framebuffer caches keyed by user-side Texture/RenderTexture identity, the active VAO, shader program, blend mode, and scissor stack. Dispatches to per-drawable renderers (WebGl2SpriteRenderer, WebGl2MeshRenderer, WebGl2ParticleRenderer) registered in the RendererRegistry. Emits WebGl2Backend.onContextLost / WebGl2Backend.onContextRestored Signals when the browser loses or regains the GL context. The browser recreates the context automatically; renderers reconnect their GPU-side state as needed on the next draw.
import { WebGl2Backend } from '@codexo/exojs' WebGL 2.0 implementation of RenderBackend. Manages the GL context, texture and framebuffer caches keyed by user-side Texture/RenderTexture identity, the active VAO, shader program, blend mode, and scissor stack. Dispatches to per-drawable renderers (WebGl2SpriteRenderer, WebGl2MeshRenderer, WebGl2ParticleRenderer) registered in the RendererRegistry.
Emits WebGl2Backend.onContextLost / WebGl2Backend.onContextRestored Signals when the browser loses or regains the GL context. The browser recreates the context automatically; renderers reconnect their GPU-side state as needed on the next draw.
new(app: Application): WebGl2Backend acquireRenderTexture(width: number, height: number): RenderTexture bindShader(shader: Shader | null): this bindTexture(texture: RenderTexture | Texture | null, unit?: number): this bindVertexArrayObject(vao: WebGl2VertexArrayObject | null): this clear(color?: Color): this composeWithAlphaMask(content: RenderTexture | Texture, mask: RenderTexture | Texture, x: number, y: number, width: number, height: number, blendMode: BlendModes): this destroy(): void draw(drawable: Drawable): this execute(pass: BackendRenderPass): this flush(): this initialize(): Promise<WebGl2Backend> popScissorRect(): this popStencilClip(): this pushScissorRect(bounds: Rectangle): this pushStencilClip(shape: Geometry, transform: Matrix): this releaseRenderTexture(texture: RenderTexture): this resetStats(): this resize(width: number, height: number): this setBlendMode(blendMode: BlendModes | null): this setClearColor(color: Color): this setRenderTarget(target: RenderTarget | null): this setView(view: View | null): this backendType: WebGl2 rendererRegistry: RendererRegistry<WebGl2Backend> clearColor: Color context: WebGL2RenderingContext renderTarget: RenderTarget stats: RenderStats view: View onContextLost: Signal<[]> onContextRestored: Signal<[]>