void
resize(int width, int height)
Source
void resize(int width, int height) {
if (_source is VideoElement) {
throw new StateError("RenderTexture is not resizeable.");
} else if (_width == width && _height == height) {
// there is no need to resize the texture
} else if (_source == null) {
_width = width;
_height = height;
if (_renderContext == null || _texture == null) return;
if (_renderContext.contextIdentifier != contextIdentifier) return;
var target = gl.TEXTURE_2D;
var rgba = gl.RGBA;
var type = gl.UNSIGNED_BYTE;
_renderContext.activateRenderTexture(this);
_renderingContext.texImage2D(target, 0, rgba, _width, _height, 0, rgba, type, null);
} else {
_width = width;
_height = height;
_canvas = _source = new CanvasElement(width: _width, height: _height);
}
}