--- title: WebGLRenderingContext.createFramebuffer() slug: Web/API/WebGLRenderingContext/createFramebuffer translation_of: Web/API/WebGLRenderingContext/createFramebuffer ---
WebGLRenderingContext.creatFramebuffer()
是 WebGL API 的一个方法,用来创建和初始化{{domxref("WebGLFramebuffer")}} 对象。WebGLFramebuffer gl.createFramebuffer();
None.
{{domxref("WebGLFramebuffer")}} 对象
var canvas = document.getElementById('canvas'); var gl = canvas.getContext('webgl'); var framebuffer = gl.createFramebuffer();
Specification | Status | Comment |
---|---|---|
{{SpecName('WebGL', "#5.14.6", "createFramebuffer")}} | {{Spec2('WebGL')}} | 初始定义. |
{{SpecName('OpenGL ES 2.0', "glGenFramebuffers.xml", "glGenFramebuffers")}} | {{Spec2('OpenGL ES 2.0')}} | OpenGL API手册(类似). |
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("api.WebGLRenderingContext.createFramebuffer")}}