什么是 window.WebGLRenderingContext? [英] What is window.WebGLRenderingContext?
问题描述
window.WebGLRenderingContext
和 canvas.getContext('experimental-webgl')
有什么区别?
我搜索了很多,但找不到答案.
I've searched a lot, but I can't find the answer.
提前致谢,
推荐答案
canvas.getContext
将返回该特定画布的绘图上下文(请参阅 规范 §2:上下文创建).它可能会从全局和静态的 window.WebGLRenderingContext
对象继承,该对象公开 WebGLRenderingContext
接口(规范 §5.14).浏览器不需要将这些原生接口暴露给 DOM 脚本 API,但它们通常会这样做.
canvas.getContext
will return a drawing context for that particular canvas (see spec §2: Context Creation). It will likely inherit from the global and static window.WebGLRenderingContext
object, which exposes the WebGLRenderingContext
interface (spec §5.14). A browser does not need to expose those native interfaces to the DOM scripting API, but they usually do.
这篇关于什么是 window.WebGLRenderingContext?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!