public bool _LoadTexture(AccessLevel al) { if (Scene.TexturePool.TextureHandle.IsTPFCube(Texture.Textures[TPFIndex], Texture.Platform)) { GPUTexture = Scene.Renderer.GlobalCubeTexturePool.AllocateTextureDescriptor(); } else { GPUTexture = Scene.Renderer.GlobalTexturePool.AllocateTextureDescriptor(); } if (Texture.Platform == TPF.TPFPlatform.PC || Texture.Platform == TPF.TPFPlatform.PS3) { Scene.Renderer.AddBackgroundUploadTask((d, cl) => { GPUTexture.FillWithTPF(d, cl, Texture.Platform, Texture.Textures[TPFIndex], Texture.Textures[TPFIndex].Name); Texture = null; }); } else if (Texture.Platform == TPF.TPFPlatform.PS4) { Scene.Renderer.AddBackgroundUploadTask((d, cl) => { GPUTexture.FillWithPS4TPF(d, cl, Texture.Platform, Texture.Textures[TPFIndex], Texture.Textures[TPFIndex].Name); Texture = null; }); } return(true); }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). } GPUTexture.Dispose(); GPUTexture = null; disposedValue = true; } }