function resizeTexture(gl, tex, options, width, height) {
    width = width || options.width;
    height = height || options.height;
    var target = options.target || gl.TEXTURE_2D;
    gl.bindTexture(target, tex);
    var format = options.format || gl.RGBA;
    var type;
    var src = options.src;
    if (!src) {
      type = options.type || gl.UNSIGNED_BYTE;
    } else if (isArrayBuffer(src) || (Array.isArray(src) && typeof (src[0]) === 'number')) {
      type = options.type || getTextureTypeForArrayType(gl, src);
    } else {
      type = options.type || gl.UNSIGNED_BYTE;
    }
    if (target === gl.TEXTURE_CUBE_MAP) {
      for (var ii = 0; ii < 6; ++ii) {
        gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, 0, format, width, height, 0, format, type, null);
      }
    } else {
      gl.texImage2D(target, 0, format, width, height, 0, format, type, null);
    }
  }
Resizes a texture based on the options passed in.

Note: This is not a generic resize anything function.
It's mostly used by {@link module:twgl.resizeFramebufferInfo}
It will use `options.src` if it exists to try to determine a `type`
otherwise it will assume `gl.UNSIGNED_BYTE`. No data is provided
for the texture. Texture parameters will be set accordingly

@param {WebGLRenderingContext} gl the WebGLRenderingContext
@param {WebGLTexture} tex the texture to resize
@param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set.
@param {number} [width] the new width. If not passed in will use `options.width`
@param {number} [height] the new height. If not passed in will use `options.height`
@memberOf module:twgl/textures