Axiom.RenderSystems.OpenGLES.GLESTexture.load C# (CSharp) Method

load() protected method

protected load ( ) : void
return void
		protected override void load()
		{
			if ( ( Usage & TextureUsage.RenderTarget ) == TextureUsage.RenderTarget )
			{
				return;
			}

			string baseName, ext = string.Empty;
			int pos = Name.LastIndexOf( '.' );
			baseName = Name.Substring( 0, pos );
			if ( pos != -1 )
			{
				ext = Name.Substring( pos + 1 );
			}

			List<Image> loadedImages = new List<Image>();

			if ( TextureType == Graphics.TextureType.TwoD )
			{
				DoImageIO( Name, Group, ext, ref loadedImages, this );
				// If this is a volumetric texture set the texture type flag accordingly.
				if ( loadedImages[ 0 ].Depth > 1 )
				{
					throw new AxiomException( "**** Unsupported 3D texture type ****" );
				}
#warning Axiom did not have Compressed Textureformat yet
				/*
				// If PVRTC and 0 custom mipmap disable auto mip generation and disable software mipmap creation
				PixelFormat imageFormat = (*loadedImages)[0].getFormat();
				if (imageFormat == PF_PVRTC_RGB2 || imageFormat == PF_PVRTC_RGBA2 ||
					imageFormat == PF_PVRTC_RGB4 || imageFormat == PF_PVRTC_RGBA4)
				{
					size_t imageMips = (*loadedImages)[0].getNumMipmaps();
					if (imageMips == 0)
					{
						mNumMipmaps = mNumRequestedMipmaps = imageMips;
						// Disable flag for auto mip generation
						mUsage &= ~TU_AUTOMIPMAP;
					}
				}*/
			}
			else
			{
				throw new AxiomException( "**** Unknown texture type ****" );
			}

			_loadedImages = loadedImages;


			if ( ( Usage & TextureUsage.RenderTarget ) == TextureUsage.RenderTarget )
			{
				CreateRenderTexture();
				return;
			}

			Image[] images = _loadedImages.ToArray();
			base.LoadImages( images );
		}