WebGLRenderingContext.wxBindCanvasTexture(number texture, Canvas canvas)

基础库 2.0.0 开始支持,低版本需做兼容处理

将一个 Canvas 对应的 Texture 绑定到 WebGL 上下文。

参数

number texture

WebGL 的纹理类型枚举值

Canvas canvas

需要绑定为 Texture 的 Canvas

示例代码

使用 wxBindCanvasTexture

gl.wxBindCanvasTexture(gl.TEXTURE_2D, canvas)

等同于

const texture = gl.createTexture()
gl.bindTexture(gl.TEXTURE_2D, texture)
// ......
gl.texImage2D(target, level, internalformat, format, type, canvas)

个结果 ""

    没有找到相关内容 ""