Interface WebGLRenderingContext

Index

Properties

Methods

Properties

public ACTIVE_UNIFORM_MAX_LENGTH: number

public INFO_LOG_LENGTH: number

public NUM_COMPRESSED_TEXTURE_FORMATS: number

public SHADER_SOURCE_LENGTH: number

Methods

public activeTexture(texture: number)

Parameters

  • texture: number

public attachShader(program: WebGLProgram, shader: WebGLShader)

Parameters

  • program: WebGLProgram
  • shader: WebGLShader

public bindAttribLocation(program: WebGLProgram, index: number, name: string)

Parameters

  • program: WebGLProgram
  • index: number
  • name: string

public bindBuffer(target: number, buffer: WebGLBuffer)

Parameters

  • target: number
  • buffer: WebGLBuffer

public bindFramebuffer(target: number, framebuffer: WebGLFramebuffer)

Parameters

  • target: number
  • framebuffer: WebGLFramebuffer

public bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer)

Parameters

  • target: number
  • renderbuffer: WebGLRenderbuffer

public bindTexture(target: number, texture: WebGLTexture)

Parameters

  • target: number
  • texture: WebGLTexture

public blendColor(red: number, green: number, blue: number, alpha: number)

Parameters

  • red: number
  • green: number
  • blue: number
  • alpha: number

public blendEquation(mode: number)

Parameters

  • mode: number

public blendEquationSeparate(modeRGB: number, modeAlpha: number)

Parameters

  • modeRGB: number
  • modeAlpha: number

public blendFunc(sfactor: number, dfactor: number)

Parameters

  • sfactor: number
  • dfactor: number

public blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number)

Parameters

  • srcRGB: number
  • dstRGB: number
  • srcAlpha: number
  • dstAlpha: number

public bufferData(target: number, size: number, usage: number)

Parameters

  • target: number
  • size: number
  • usage: number

public bufferData(target: number, data: ArrayBufferView, usage: number)

Parameters

  • target: number
  • data: ArrayBufferView
  • usage: number

public bufferData(target: number, data: ArrayBuffer, usage: number)

Parameters

  • target: number
  • data: ArrayBuffer
  • usage: number

public bufferSubData(target: number, offset: number, data: ArrayBufferView)

Parameters

  • target: number
  • offset: number
  • data: ArrayBufferView

public bufferSubData(target: number, offset: number, data: ArrayBuffer)

Parameters

  • target: number
  • offset: number
  • data: ArrayBuffer

public checkFramebufferStatus(target: number): number

Parameters

  • target: number

Returns

number

public clear(mask: number)

Parameters

  • mask: number

public clearColor(red: number, green: number, blue: number, alpha: number)

Parameters

  • red: number
  • green: number
  • blue: number
  • alpha: number

public clearDepth(depth: number)

Parameters

  • depth: number

public clearStencil(s: number)

Parameters

  • s: number

public colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean)

Parameters

  • red: boolean
  • green: boolean
  • blue: boolean
  • alpha: boolean

public compileShader(shader: WebGLShader)

Parameters

  • shader: WebGLShader

public copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number)

Parameters

  • target: number
  • level: number
  • internalformat: number
  • x: number
  • y: number
  • width: number
  • height: number
  • border: number

public copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number)

Parameters

  • target: number
  • level: number
  • xoffset: number
  • yoffset: number
  • x: number
  • y: number
  • width: number
  • height: number

public createBuffer(): WebGLBuffer

Returns

WebGLBuffer

public createFramebuffer(): WebGLFramebuffer

Returns

WebGLFramebuffer

public createProgram(): WebGLProgram

Returns

WebGLProgram

public createRenderbuffer(): WebGLRenderbuffer

Returns

WebGLRenderbuffer

public createShader(type: number): WebGLShader

Parameters

  • type: number

Returns

WebGLShader

public createTexture(): WebGLTexture

Returns

WebGLTexture

public cullFace(mode: number)

Parameters

  • mode: number

public deleteBuffer(buffer: WebGLBuffer)

Parameters

  • buffer: WebGLBuffer

public deleteFramebuffer(framebuffer: WebGLFramebuffer)

Parameters

  • framebuffer: WebGLFramebuffer

public deleteProgram(program: WebGLProgram)

Parameters

  • program: WebGLProgram

public deleteRenderbuffer(renderbuffer: WebGLRenderbuffer)

Parameters

  • renderbuffer: WebGLRenderbuffer

public deleteShader(shader: WebGLShader)

Parameters

  • shader: WebGLShader

public deleteTexture(texture: WebGLTexture)

Parameters

  • texture: WebGLTexture

public depthFunc(func: number)

Parameters

  • func: number

public depthMask(flag: boolean)

Parameters

  • flag: boolean

public depthRange(zNear: number, zFar: number)

Parameters

  • zNear: number
  • zFar: number

public detachShader(program: WebGLProgram, shader: WebGLShader)

Parameters

  • program: WebGLProgram
  • shader: WebGLShader

public disable(cap: number)

Parameters

  • cap: number

public disableVertexAttribArray(index: number)

Parameters

  • index: number

public drawArrays(mode: number, first: number, count: number)

Parameters

  • mode: number
  • first: number
  • count: number

public drawElements(mode: number, count: number, type: number, offset: number)

Parameters

  • mode: number
  • count: number
  • type: number
  • offset: number

public enable(cap: number)

Parameters

  • cap: number

public enableVertexAttribArray(index: number)

Parameters

  • index: number

public finish()

public flush()

public framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer)

Parameters

  • target: number
  • attachment: number
  • renderbuffertarget: number
  • renderbuffer: WebGLRenderbuffer

public framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number)

Parameters

  • target: number
  • attachment: number
  • textarget: number
  • texture: WebGLTexture
  • level: number

public frontFace(mode: number)

Parameters

  • mode: number

public generateMipmap(target: number)

Parameters

  • target: number

public getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo

Parameters

  • program: WebGLProgram
  • index: number

Returns

WebGLActiveInfo

public getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo

Parameters

  • program: WebGLProgram
  • index: number

Returns

WebGLActiveInfo

public getAttachedShaders(program: WebGLProgram): Array<WebGLShader>

Parameters

  • program: WebGLProgram

Returns

Array<WebGLShader>

public getAttribLocation(program: WebGLProgram, name: string): number

Parameters

  • program: WebGLProgram
  • name: string

Returns

number

public getBufferParameter(target: number, pname: number): any

Parameters

  • target: number
  • pname: number

Returns

any

public getContextAttributes(): WebGLContextAttributes

Returns

WebGLContextAttributes

public getError(): number

Returns

number

public getExtension(name: string): any

Parameters

  • name: string

Returns

any

public getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any

Parameters

  • target: number
  • attachment: number
  • pname: number

Returns

any

public getParameter(pname: number): any

Parameters

  • pname: number

Returns

any

public getProgramInfoLog(program: WebGLProgram): string

Parameters

  • program: WebGLProgram

Returns

string

public getProgramParameter(program: WebGLProgram, pname: number): any

Parameters

  • program: WebGLProgram
  • pname: number

Returns

any

public getRenderbufferParameter(target: number, pname: number): any

Parameters

  • target: number
  • pname: number

Returns

any

public getShaderInfoLog(shader: WebGLShader): string

Parameters

  • shader: WebGLShader

Returns

string

public getShaderParameter(shader: WebGLShader, pname: number): any

Parameters

  • shader: WebGLShader
  • pname: number

Returns

any

public getShaderSource(shader: WebGLShader): string

Parameters

  • shader: WebGLShader

Returns

string

public getSupportedExtensions(): Array<string>

Returns

Array<string>

public getTexParameter(target: number, pname: number): any

Parameters

  • target: number
  • pname: number

Returns

any

public getUniform(program: WebGLProgram, location: WebGLUniformLocation): any

Parameters

  • program: WebGLProgram
  • location: WebGLUniformLocation

Returns

any

public getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation

Parameters

  • program: WebGLProgram
  • name: string

Returns

WebGLUniformLocation

public getVertexAttrib(index: number, pname: number): any

Parameters

  • index: number
  • pname: number

Returns

any

public getVertexAttribOffset(index: number, pname: number): number

Parameters

  • index: number
  • pname: number

Returns

number

public hint(target: number, mode: number)

Parameters

  • target: number
  • mode: number

public isBuffer(buffer: WebGLBuffer): boolean

Parameters

  • buffer: WebGLBuffer

Returns

boolean

public isContextLost(): boolean

Returns

boolean

public isEnabled(cap: number): boolean

Parameters

  • cap: number

Returns

boolean

public isFramebuffer(framebuffer: WebGLFramebuffer): boolean

Parameters

  • framebuffer: WebGLFramebuffer

Returns

boolean

public isProgram(program: WebGLProgram): boolean

Parameters

  • program: WebGLProgram

Returns

boolean

public isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean

Parameters

  • renderbuffer: WebGLRenderbuffer

Returns

boolean

public isShader(shader: WebGLShader): boolean

Parameters

  • shader: WebGLShader

Returns

boolean

public isTexture(texture: WebGLTexture): boolean

Parameters

  • texture: WebGLTexture

Returns

boolean

public lineWidth(width: number)

Parameters

  • width: number

public linkProgram(program: WebGLProgram)

Parameters

  • program: WebGLProgram

public pixelStorei(pname: number, param: number)

Parameters

  • pname: number
  • param: number

public polygonOffset(factor: number, units: number)

Parameters

  • factor: number
  • units: number

public readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView)

Parameters

  • x: number
  • y: number
  • width: number
  • height: number
  • format: number
  • type: number
  • pixels: ArrayBufferView

public renderbufferStorage(target: number, internalformat: number, width: number, height: number)

Parameters

  • target: number
  • internalformat: number
  • width: number
  • height: number

public sampleCoverage(value: number, invert: boolean)

Parameters

  • value: number
  • invert: boolean

public scissor(x: number, y: number, width: number, height: number)

Parameters

  • x: number
  • y: number
  • width: number
  • height: number

public shaderSource(shader: WebGLShader, source: string)

Parameters

  • shader: WebGLShader
  • source: string

public stencilFunc(func: number, ref: number, mask: number)

Parameters

  • func: number
  • ref: number
  • mask: number

public stencilFuncSeparate(face: number, func: number, ref: number, mask: number)

Parameters

  • face: number
  • func: number
  • ref: number
  • mask: number

public stencilMask(mask: number)

Parameters

  • mask: number

public stencilMaskSeparate(face: number, mask: number)

Parameters

  • face: number
  • mask: number

public stencilOp(fail: number, zfail: number, zpass: number)

Parameters

  • fail: number
  • zfail: number
  • zpass: number

public stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number)

Parameters

  • face: number
  • fail: number
  • zfail: number
  • zpass: number

public texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView)

Parameters

  • target: number
  • level: number
  • internalformat: number
  • width: number
  • height: number
  • border: number
  • format: number
  • type: number
  • pixels: ArrayBufferView

public texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData)

Parameters

  • target: number
  • level: number
  • internalformat: number
  • format: number
  • type: number
  • pixels: ImageData

public texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement)

Parameters

  • target: number
  • level: number
  • internalformat: number
  • format: number
  • type: number
  • image: HTMLImageElement

public texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement)

Parameters

  • target: number
  • level: number
  • internalformat: number
  • format: number
  • type: number
  • canvas: HTMLCanvasElement

public texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement)

Parameters

  • target: number
  • level: number
  • internalformat: number
  • format: number
  • type: number
  • video: HTMLVideoElement

public texParameterf(target: number, pname: number, param: number)

Parameters

  • target: number
  • pname: number
  • param: number

public texParameteri(target: number, pname: number, param: number)

Parameters

  • target: number
  • pname: number
  • param: number

public texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView)

Parameters

  • target: number
  • level: number
  • xoffset: number
  • yoffset: number
  • width: number
  • height: number
  • format: number
  • type: number
  • pixels: ArrayBufferView

public texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData)

Parameters

  • target: number
  • level: number
  • xoffset: number
  • yoffset: number
  • format: number
  • type: number
  • pixels: ImageData

public texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement)

Parameters

  • target: number
  • level: number
  • xoffset: number
  • yoffset: number
  • format: number
  • type: number
  • image: HTMLImageElement

public texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement)

Parameters

  • target: number
  • level: number
  • xoffset: number
  • yoffset: number
  • format: number
  • type: number
  • canvas: HTMLCanvasElement

public texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement)

Parameters

  • target: number
  • level: number
  • xoffset: number
  • yoffset: number
  • format: number
  • type: number
  • video: HTMLVideoElement

public uniform1f(location: WebGLUniformLocation, x: number)

Parameters

  • location: WebGLUniformLocation
  • x: number

public uniform1fv(location: WebGLUniformLocation, v: Float32Array)

Parameters

  • location: WebGLUniformLocation
  • v: Float32Array

public uniform1fv(location: WebGLUniformLocation, v: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • v: Array<number>

public uniform1i(location: WebGLUniformLocation, x: number)

Parameters

  • location: WebGLUniformLocation
  • x: number

public uniform1iv(location: WebGLUniformLocation, v: Int32Array)

Parameters

  • location: WebGLUniformLocation
  • v: Int32Array

public uniform1iv(location: WebGLUniformLocation, v: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • v: Array<number>

public uniform2f(location: WebGLUniformLocation, x: number, y: number)

Parameters

  • location: WebGLUniformLocation
  • x: number
  • y: number

public uniform2fv(location: WebGLUniformLocation, v: Float32Array)

Parameters

  • location: WebGLUniformLocation
  • v: Float32Array

public uniform2fv(location: WebGLUniformLocation, v: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • v: Array<number>

public uniform2i(location: WebGLUniformLocation, x: number, y: number)

Parameters

  • location: WebGLUniformLocation
  • x: number
  • y: number

public uniform2iv(location: WebGLUniformLocation, v: Int32Array)

Parameters

  • location: WebGLUniformLocation
  • v: Int32Array

public uniform2iv(location: WebGLUniformLocation, v: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • v: Array<number>

public uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number)

Parameters

  • location: WebGLUniformLocation
  • x: number
  • y: number
  • z: number

public uniform3fv(location: WebGLUniformLocation, v: Float32Array)

Parameters

  • location: WebGLUniformLocation
  • v: Float32Array

public uniform3fv(location: WebGLUniformLocation, v: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • v: Array<number>

public uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number)

Parameters

  • location: WebGLUniformLocation
  • x: number
  • y: number
  • z: number

public uniform3iv(location: WebGLUniformLocation, v: Int32Array)

Parameters

  • location: WebGLUniformLocation
  • v: Int32Array

public uniform3iv(location: WebGLUniformLocation, v: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • v: Array<number>

public uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number)

Parameters

  • location: WebGLUniformLocation
  • x: number
  • y: number
  • z: number
  • w: number

public uniform4fv(location: WebGLUniformLocation, v: Float32Array)

Parameters

  • location: WebGLUniformLocation
  • v: Float32Array

public uniform4fv(location: WebGLUniformLocation, v: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • v: Array<number>

public uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number)

Parameters

  • location: WebGLUniformLocation
  • x: number
  • y: number
  • z: number
  • w: number

public uniform4iv(location: WebGLUniformLocation, v: Int32Array)

Parameters

  • location: WebGLUniformLocation
  • v: Int32Array

public uniform4iv(location: WebGLUniformLocation, v: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • v: Array<number>

public uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array)

Parameters

  • location: WebGLUniformLocation
  • transpose: boolean
  • value: Float32Array

public uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • transpose: boolean
  • value: Array<number>

public uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array)

Parameters

  • location: WebGLUniformLocation
  • transpose: boolean
  • value: Float32Array

public uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • transpose: boolean
  • value: Array<number>

public uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array)

Parameters

  • location: WebGLUniformLocation
  • transpose: boolean
  • value: Float32Array

public uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Array<number>)

Parameters

  • location: WebGLUniformLocation
  • transpose: boolean
  • value: Array<number>

public useProgram(program: WebGLProgram)

Parameters

  • program: WebGLProgram

public validateProgram(program: WebGLProgram)

Parameters

  • program: WebGLProgram

public vertexAttrib1f(indx: number, x: number)

Parameters

  • indx: number
  • x: number

public vertexAttrib1fv(indx: number, values: Float32Array)

Parameters

  • indx: number
  • values: Float32Array

public vertexAttrib1fv(indx: number, values: Array<number>)

Parameters

  • indx: number
  • values: Array<number>

public vertexAttrib2f(indx: number, x: number, y: number)

Parameters

  • indx: number
  • x: number
  • y: number

public vertexAttrib2fv(indx: number, values: Float32Array)

Parameters

  • indx: number
  • values: Float32Array

public vertexAttrib2fv(indx: number, values: Array<number>)

Parameters

  • indx: number
  • values: Array<number>

public vertexAttrib3f(indx: number, x: number, y: number, z: number)

Parameters

  • indx: number
  • x: number
  • y: number
  • z: number

public vertexAttrib3fv(indx: number, values: Float32Array)

Parameters

  • indx: number
  • values: Float32Array

public vertexAttrib3fv(indx: number, values: Array<number>)

Parameters

  • indx: number
  • values: Array<number>

public vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number)

Parameters

  • indx: number
  • x: number
  • y: number
  • z: number
  • w: number

public vertexAttrib4fv(indx: number, values: Float32Array)

Parameters

  • indx: number
  • values: Float32Array

public vertexAttrib4fv(indx: number, values: Array<number>)

Parameters

  • indx: number
  • values: Array<number>

public vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number)

Parameters

  • indx: number
  • size: number
  • type: number
  • normalized: boolean
  • stride: number
  • offset: number

public viewport(x: number, y: number, width: number, height: number)

Parameters

  • x: number
  • y: number
  • width: number
  • height: number