MCPcopy Create free account
hub / github.com/microsoft/SandDance / cloneTextureFrom

Function cloneTextureFrom

docs/app/js/sanddance-app.js:60667–60681  ·  view source on GitHub ↗
(refTexture, overrides)

Source from the content-addressed store, hash-verified

60665var _framebufferDefault = parcelHelpers.interopDefault(_framebuffer);
60666var _utils = require("../utils");
60667function cloneTextureFrom(refTexture, overrides) {
60668 (0, _utils.assert)(refTexture instanceof (0, _texture2DDefault.default) || refTexture instanceof (0, _textureCubeDefault.default) || refTexture instanceof (0, _texture3DDefault.default));
60669 var TextureType = refTexture.constructor;
60670 var gl = refTexture.gl, width = refTexture.width, height = refTexture.height, format = refTexture.format, type = refTexture.type, dataFormat = refTexture.dataFormat, border = refTexture.border, mipmaps = refTexture.mipmaps;
60671 var textureOptions = Object.assign({
60672 width: width,
60673 height: height,
60674 format: format,
60675 type: type,
60676 dataFormat: dataFormat,
60677 border: border,
60678 mipmaps: mipmaps
60679 }, overrides);
60680 return new TextureType(gl, textureOptions);
60681}
60682function toFramebuffer(texture, opts) {
60683 var gl = texture.gl, width = texture.width, height = texture.height, id = texture.id;
60684 var framebuffer = new (0, _framebufferDefault.default)(gl, Object.assign({}, opts, {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected