2021SC@SDUSC
目录
FrameBuffer.js
2.函数部分
checkStatus
checkStatus: function (_gl) {
return _gl.checkFramebufferStatus(GL_FRAMEBUFFER);
},
用于检测帧缓冲状态;
attach
if (!texture.width) {
throw new Error('The texture attached to color buffer is not a valid.');
}
首先判断纹理是否合法可用;
attachment = attachment || GL_COLOR_ATTACHMENT0;
target = target || glenum.TEXTURE_2D;
var boundRenderer = this._boundRenderer;
var _gl = boundRenderer && boundRenderer.gl;
var attachedTextures;
if (_gl) {
var cache = this._cache;
cache.use(boundRenderer.__uid__);
attachedTextures = cache.get