WebGLRenderingContext.useProgram()

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

 WebGLRenderingContext.useProgram() 方法将定义好的WebGLProgram 对象添加到当前的渲染状态中。

语法

void gl.useProgram(program);

参数

program
需要添加的WebGLProgram对象

返回参数

无.

示例

var program = gl.createProgram();

// Attach pre-existing shaders
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);

gl.linkProgram(program);
gl.useProgram(program);

规范

Specification Status Comment
WebGL 1.0
useProgram
Recommendation 原始定义.
OpenGL ES 2.0
glUseProgram
Standard 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

相关资料

文档标签和贡献者

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