API reference

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

C

classSampler

@codexo/exojs / rendering / stable

WebGL2 sampler object wrapper that controls texture filtering and wrapping. Creates a `WebGLSampler` on construction and updates its parameters whenever `scaleMode` or `wrapMode` changes. Bind the sampler to a texture unit with bind before issuing draw calls. Note: `premultiplyAlpha`, `generateMipMap`, and `flipY` are pixel-store parameters handled at texture upload time; this class only manages filter and wrap state.

3
props
4
methods
0
events
Import
import { Sampler } from '@codexo/exojs'

WebGL2 sampler object wrapper that controls texture filtering and wrapping.

Creates a `WebGLSampler` on construction and updates its parameters whenever `scaleMode` or `wrapMode` changes. Bind the sampler to a texture unit with bind before issuing draw calls. Note: `premultiplyAlpha`, `generateMipMap`, and `flipY` are pixel-store parameters handled at texture upload time; this class only manages filter and wrap state.

Constructors 1
new(gl: WebGL2RenderingContext, options: SamplerOptions): Sampler
Methods 4
bind(textureUnit: number): this
destroy(): void
setScaleMode(scaleMode: ScaleModes): this
setWrapMode(wrapMode: WrapModes): this
Properties 3
sampler: WebGLSampler | null
scaleMode: ScaleModes
wrapMode: WrapModes
Source