fireball/lib/textures/DataTexture.js

30 lines
853 B
JavaScript
Raw Normal View History

2018-12-25 13:59:22 +00:00
/**
* @author alteredq / http://alteredqualia.com/
*/
import { Texture } from './Texture.js';
import { NearestFilter } from '../constants.js';
function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
this.image = { data: data, width: width, height: height };
this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
this.generateMipmaps = false;
this.flipY = false;
this.unpackAlignment = 1;
}
DataTexture.prototype = Object.create( Texture.prototype );
DataTexture.prototype.constructor = DataTexture;
DataTexture.prototype.isDataTexture = true;
export { DataTexture };