UNPKG

853 BJavaScriptView Raw
1/**
2 * @author alteredq / http://alteredqualia.com/
3 */
4
5import { Texture } from './Texture.js';
6import { NearestFilter } from '../constants.js';
7
8function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
9
10 Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
11
12 this.image = { data: data, width: width, height: height };
13
14 this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
15 this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
16
17 this.generateMipmaps = false;
18 this.flipY = false;
19 this.unpackAlignment = 1;
20
21}
22
23DataTexture.prototype = Object.create( Texture.prototype );
24DataTexture.prototype.constructor = DataTexture;
25
26DataTexture.prototype.isDataTexture = true;
27
28
29export { DataTexture };