source: other-projects/playing-in-the-street/summer-2013/trunk/Playing-in-the-Street-WPF/Content/Web/mrdoob-three.js-4862f5f/src/loaders/TextureLoader.js@ 28897

Last change on this file since 28897 was 28897, checked in by davidb, 10 years ago

GUI front-end to server base plus web page content

File size: 701 bytes
Line 
1/**
2 * @author mrdoob / http://mrdoob.com/
3 */
4
5THREE.TextureLoader = function ( manager ) {
6
7 this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
8
9};
10
11THREE.TextureLoader.prototype = {
12
13 constructor: THREE.TextureLoader,
14
15 load: function ( url, onLoad, onProgress, onError ) {
16
17 var scope = this;
18
19 var loader = new THREE.ImageLoader( scope.manager );
20 loader.setCrossOrigin( this.crossOrigin );
21 loader.load( url, function ( image ) {
22
23 var texture = new THREE.Texture( image );
24 texture.needsUpdate = true;
25
26 if ( onLoad !== undefined ) {
27
28 onLoad( texture );
29
30 }
31
32 } );
33
34 },
35
36 setCrossOrigin: function ( value ) {
37
38 this.crossOrigin = value;
39
40 }
41
42};
Note: See TracBrowser for help on using the repository browser.