fireball/lib/textures/VideoTexture.js

37 lines
640 B
JavaScript
Raw Normal View History

2018-12-25 13:59:22 +00:00
/**
* @author mrdoob / http://mrdoob.com/
*/
import { Texture } from './Texture.js';
function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
this.generateMipmaps = false;
}
VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
constructor: VideoTexture,
isVideoTexture: true,
update: function () {
var video = this.image;
if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
this.needsUpdate = true;
}
}
} );
export { VideoTexture };