API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classShader

@codexo/exojs / rendering / stable

Backend-agnostic shader program descriptor. Holds raw GLSL source strings and, after connect is called, a live ShaderProgram with populated attributes and uniforms maps. Call bind before draw calls and sync after updating uniform values. Both maps are cleared on disconnect and destroy.

4
props
8
methods
0
events
Import
import { Shader } from '@codexo/exojs'

Backend-agnostic shader program descriptor.

Holds raw GLSL source strings and, after connect is called, a live ShaderProgram with populated attributes and uniforms maps. Call bind before draw calls and sync after updating uniform values. Both maps are cleared on disconnect and destroy.

Constructors 1
new(vertexSource: string, fragmentSource: string): Shader
Methods 8
bind(): this
connect(program: ShaderProgram): this
destroy(): void
disconnect(): this
getAttribute(name: string): ShaderAttribute
getUniform(name: string): ShaderUniform
sync(): this
unbind(): this
Properties 4
attributes: Map<string, ShaderAttribute>
uniforms: Map<string, ShaderUniform>
fragmentSource: string
vertexSource: string
Source