@@ -208,101 +208,6 @@ Phaser.TextureManager.prototype = {
208208
209209 callback . apply ( thisArg , args ) ;
210210 }
211- } ,
212-
213- /**
214- * TODO: This should move to the WebGL Renderer class.
215- *
216- * Removes the base texture from the GPU, useful for managing resources on the GPU.
217- * A texture is still 100% usable and will simply be re-uploaded if there is a sprite on screen that is using it.
218- *
219- * @method unloadFromGPU
220- */
221- unloadFromGPU : function ( )
222- {
223- this . dirty ( ) ;
224-
225- // delete the webGL textures if any.
226- for ( var i = this . _glTextures . length - 1 ; i >= 0 ; i -- )
227- {
228- var glTexture = this . _glTextures [ i ] ;
229- var gl = PIXI . glContexts [ i ] ;
230-
231- if ( gl && glTexture )
232- {
233- gl . deleteTexture ( glTexture ) ;
234- }
235- }
236-
237- this . _glTextures . length = 0 ;
238-
239- this . dirty ( ) ;
240- } ,
241-
242- /**
243- * TODO: This should move to the WebGL Renderer class.
244- *
245- * Updates and Creates a WebGL texture for the renderers context.
246- *
247- * @method updateTexture
248- * @param texture {Texture} the texture to update
249- * @return {boolean } True if the texture was successfully bound, otherwise false.
250- */
251- loadToGPU : function ( texture )
252- {
253- if ( ! texture . hasLoaded )
254- {
255- return false ;
256- }
257-
258- if ( texture . source . compressionAlgorithm )
259- {
260- return this . updateCompressedTexture ( texture ) ;
261- }
262-
263- var gl = this . gl ;
264-
265- if ( ! texture . _glTextures [ gl . id ] )
266- {
267- texture . _glTextures [ gl . id ] = gl . createTexture ( ) ;
268- }
269-
270- gl . activeTexture ( gl . TEXTURE0 + texture . textureIndex ) ;
271-
272- gl . bindTexture ( gl . TEXTURE_2D , texture . _glTextures [ gl . id ] ) ;
273-
274- gl . pixelStorei ( gl . UNPACK_PREMULTIPLY_ALPHA_WEBGL , texture . premultipliedAlpha ) ;
275-
276- gl . texImage2D ( gl . TEXTURE_2D , 0 , gl . RGBA , gl . RGBA , gl . UNSIGNED_BYTE , texture . source ) ;
277-
278- gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MAG_FILTER , texture . scaleMode === Phaser . scaleModes . LINEAR ? gl . LINEAR : gl . NEAREST ) ;
279-
280- if ( texture . mipmap && Phaser . Math . isPowerOfTwo ( texture . width , texture . height ) )
281- {
282- gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MIN_FILTER , texture . scaleMode === Phaser . scaleModes . LINEAR ? gl . LINEAR_MIPMAP_LINEAR : gl . NEAREST_MIPMAP_NEAREST ) ;
283- gl . generateMipmap ( gl . TEXTURE_2D ) ;
284- }
285- else
286- {
287- gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_MIN_FILTER , texture . scaleMode === Phaser . scaleModes
8096
. LINEAR ? gl . LINEAR : gl . NEAREST ) ;
288- }
289-
290- if ( ! texture . _powerOf2 )
291- {
292- gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_WRAP_S , gl . CLAMP_TO_EDGE ) ;
293- gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_WRAP_T , gl . CLAMP_TO_EDGE ) ;
294- }
295- else
296- {
297- gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_WRAP_S , gl . REPEAT ) ;
298- gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_WRAP_T , gl . REPEAT ) ;
299- }
300-
301- texture . _dirty [ gl . id ] = false ;
302-
303- // return texture._glTextures[gl.id];
304- return true ;
305-
306211 }
307212
308213} ;
0 commit comments