Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Texture2D

Hierarchy

Index

Constructors

constructor

  • new Texture2D(gl: WebGLRenderingContext): Texture2D

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>>

Static defaultTextures

defaultTextures: Map<WebGLRenderingContext, Texture2D> = new Map<WebGLRenderingContext, Texture2D>()

Static maxTextureSize

maxTextureSize: number

Accessors

drawerContext

  • get drawerContext(): CanvasRenderingContext2D

format

  • get format(): number

height

  • get height(): 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

viewport

width

  • get width(): number

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

applyDraw

  • applyDraw(): void

destroy

  • destroy(): void

getRawPixels

  • getRawPixels<T>(x?: number, y?: number, width?: number, height?: number): T
  • Type parameters

    • T: ArrayBufferView

    Parameters

    • Default value x: number = 0
    • Default value y: number = 0
    • Default value width: number = this.width
    • Default value height: number = this.height

    Returns T

register

  • register(registerNumber: number): void

setMetadata

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

update

  • update(level: number, width: number, height: number, border: number, format: number, type: number, pxiels?: ArrayBufferView, config?: ImageUploadConfig): void
  • update(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, config?: ImageUploadConfig): void

updateDrawerCanvas

  • updateDrawerCanvas(): void

Static generateDefaultTexture

  • generateDefaultTexture(gl: WebGLRenderingContext): void

Generated using TypeDoc