--- title: WebGLRenderingContext.deleteBuffer() slug: Web/API/WebGLRenderingContext/deleteBuffer translation_of: Web/API/WebGLRenderingContext/deleteBuffer ---
WebGLRenderingContext.deleteBuffer()
用于删除给定的{{domxref("WebGLBuffer")}}对象;若给定的{{domxref("WebGLBuffer")}}对象已经被删除了,调用该方法将不会产生任何效果。
void gl.deleteBuffer(buffer);
None.
var canvas = document.getElementById('canvas'); var gl = canvas.getContext('webgl'); var buffer = gl.createBuffer(); // ... gl.deleteBuffer(buffer);
Specification | Status | Comment |
---|---|---|
{{SpecName('WebGL', "#5.14.5", "deleteBuffer")}} | {{Spec2('WebGL')}} | Initial definition. |
{{SpecName('OpenGL ES 2.0', "glDeleteBuffers.xml", "glDeleteBuffers")}} | {{Spec2('OpenGL ES 2.0')}} | Man page of the (similar) OpenGL API. |
{{Compat("api.WebGLRenderingContext.deleteBuffer")}}