function resizeFramebufferInfo(gl, framebufferInfo, attachments, width, height) {
  width = width || gl.drawingBufferWidth;
  height = height || gl.drawingBufferHeight;
  framebufferInfo.width = width;
  framebufferInfo.height = height;
  attachments = attachments || defaultAttachments;
  attachments.forEach(function (attachmentOptions, ndx) {
    var attachment = framebufferInfo.attachments[ndx];
    var format = attachmentOptions.format;
    var samples = attachmentOptions.samples;

    if (samples !== undefined || helper.isRenderbuffer(gl, attachment)) {
      gl.bindRenderbuffer(RENDERBUFFER, attachment);

      if (samples > 1) {
        gl.renderbufferStorageMultisample(RENDERBUFFER, samples, format, width, height);
      } else {
        gl.renderbufferStorage(RENDERBUFFER, format, width, height);
      }
    } else if (helper.isTexture(gl, attachment)) {
      textures.resizeTexture(gl, attachment, attachmentOptions, width, height);
    } else {
      throw new Error('unknown attachment type');
    }
  });
}
Resizes the attachments of a framebuffer.

You need to pass in the same `attachments` as you passed in {@link module:twgl.createFramebufferInfo}
because TWGL has no idea the format/type of each attachment.

The simplest usage

    // create an RGBA/UNSIGNED_BYTE texture and DEPTH_STENCIL renderbuffer
    const fbi = twgl.createFramebufferInfo(gl);

    ...

    function render() {
      if (twgl.resizeCanvasToDisplaySize(gl.canvas)) {
        // resize the attachments
        twgl.resizeFramebufferInfo(gl, fbi);
      }

More complex usage

    // create an RGB565 renderbuffer and a STENCIL_INDEX8 renderbuffer
    const attachments = [
      { format: RGB565, mag: NEAREST },
      { format: STENCIL_INDEX8 },
    ]
    const fbi = twgl.createFramebufferInfo(gl, attachments);

    ...

    function render() {
      if (twgl.resizeCanvasToDisplaySize(gl.canvas)) {
        // resize the attachments to match
        twgl.resizeFramebufferInfo(gl, fbi, attachments);
      }

@param {WebGLRenderingContext} gl the WebGLRenderingContext
@param {module:twgl.FramebufferInfo} framebufferInfo a framebufferInfo as returned from {@link module:twgl.createFramebufferInfo}.
@param {module:twgl.AttachmentOptions[]} [attachments] the same attachments options as passed to {@link module:twgl.createFramebufferInfo}.
@param {number} [width] the width for the attachments. Default = size of drawingBuffer
@param {number} [height] the height for the attachments. Default = size of drawingBuffer
@memberOf module:twgl/framebuffers