WebGLRenderingContext.createTexture()

这篇翻译不完整。请帮忙从英语翻译这篇文章

WebGL APIWebGLRenderingContext.createTexture() 方法创建并初始化了一个WebGLTexture 目标。

语法

WebGLTexture gl.createTexture();

参数

无。

返回值

一个可以被任何图像绑定的 WebGLTexture 目标

示例

另见 Using textures in WebGL上的WebGL tutorial

创建一个纹理

var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var texture = gl.createTexture();

规范

Specification Status Comment
WebGL 1.0
createTexture
Recommendation Initial definition.
OpenGL ES 2.0
glGenTextures
Standard Man page of the (similar) OpenGL API.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 9Edge Full support 12Firefox Full support 4IE Full support 11Opera Full support 12Safari Full support 5.1WebView Android Full support YesChrome Android Full support 25Edge Mobile Full support YesFirefox Android Full support YesOpera Android Full support 12Safari iOS Full support 8.1Samsung Internet Android Full support Yes

Legend

Full support  
Full support

另见

文档标签和贡献者

此页面的贡献者: Sylvia_Y
最后编辑者: Sylvia_Y,