Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Texture

Hierarchy

Index

Constructors

constructor

  • new Texture(gl: WebGLRenderingContext, textureType: number): Texture

Properties

Protected ___format

___format: number = WebGLRenderingContext.RGBA

Protected ___type

___type: number = WebGLRenderingContext.UNSIGNED_BYTE

destroyed

destroyed: boolean = false

gl

gl: WebGLRenderingContext

index

index: number

resourceReference

resourceReference: WebGLTexture

textureType

textureType: number

validPromise

validPromise: Promise<GLResource<WebGLTexture>>

Accessors

format

  • get format(): number

magFilter

  • get magFilter(): number
  • set magFilter(filter: number): void

metadata

  • get metadata(): object

minFilter

  • get minFilter(): number
  • set minFilter(filter: number): void

type

  • get type(): number

valid

  • get valid(): boolean
  • set valid(val: boolean): void

wrapS

  • get wrapS(): number
  • set wrapS(filter: number): void

wrapT

  • get wrapT(): number
  • set wrapT(filter: number): void

Methods

Protected ___applyTexParameter

  • ___applyTexParameter(): void

Protected ___ensureMipmap

  • ___ensureMipmap(): void

Protected ___ensurePOT

  • ___ensurePOT(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement): IResizeResult
  • Ensure specified resource is POT(Power of Two) resource. If speciefied resource was NPOT, resize specified resource to POT.

    Parameters

    • image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement

    Returns IResizeResult

Protected ___getRawPixels

  • ___getRawPixels<T>(type: number, format: number, x?: number, y?: number, width: number, height: number, from: number): T
  • Type parameters

    • T: ArrayBufferView

    Parameters

    • type: number
    • format: number
    • Default value x: number = 0
    • Default value y: number = 0
    • width: number
    • height: number
    • from: number

    Returns T

Protected ___needMipmap

  • ___needMipmap(minFilter: number): boolean
  • Check specified min filter requires mip map or not.

    Parameters

    • minFilter: number

      min filter type

    Returns boolean

destroy

  • destroy(): void

register

  • register(registerNumber: number): void

setMetadata

  • setMetadata(key: string, value: any): void

Generated using TypeDoc