# WebGLRenderingContext.wxBindCanvasTexture(number texture, Canvas canvas)

Start from base library version 2.0.0. Please remaining backward compatible.

Links the texture of a canvas to the WebGL context.

# Parameters

# number texture

Enumerated values for WebGL texture types

# Canvas canvas

The canvas whose texture needs to be linked.

# Sample Code

Use wxBindCanvasTexture

gl.wxBindCanvasTexture(gl.TEXTURE_2D, canvas)

equivalent to

const texture = gl.createTexture()
gl.bindTexture(gl.TEXTURE_2D, texture)
// ......
gl.texImage2D(target, level, internalformat, format, type, canvas)
点击咨询小助手