--- title: WebGLRenderingContext.deleteProgram() slug: Web/API/WebGLRenderingContext/deleteProgram translation_of: Web/API/WebGLRenderingContext/deleteProgram ---
WebGLRenderingContext.deleteProgram()
用于删除一个 {{domxref("WebGLProgram")}} 对象. 如果该{{domxref("WebGLProgram")}} 对象已经被删除,该方法不会产生任何作用
void gl.deleteProgram(program);
program
None.
var canvas = document.getElementById('canvas'); var gl = canvas.getContext('webgl'); var program = gl.createProgram(); // ... gl.deleteProgram(program);
规格 | 状态 | 解释 |
---|---|---|
{{SpecName('WebGL', "#5.14.9", "deleteProgram")}} | {{Spec2('WebGL')}} | Initial definition. |
{{SpecName('OpenGL ES 2.0', "glDeleteProgram.xml", "glDeleteProgram")}} | {{Spec2('OpenGL ES 2.0')}} | Man page of the (similar) OpenGL API. |
{{Compat("api.WebGLRenderingContext.deleteProgram")}}