Deletes the framebuffer from GPU memory.
Calling myBuffer.remove()
frees the GPU memory used by the framebuffer. The framebuffer also uses a bit of memory on the CPU which can be freed like so:
// Delete the framebuffer from GPU memory.
myBuffer.remove();
// Delete the framebuffer from CPU memory.
myBuffer = undefined;
Note: All variables that reference the framebuffer must be assigned the value undefined
to delete the framebuffer from CPU memory. If any variable still refers to the framebuffer, then it won't be garbage collected.
示例
Notice any errors or typos? Please let us know. Please feel free to edit src/webgl/p5.Framebuffer.js and open a pull request!