FSO.Files.Formats.IFF.Chunks.SPR2Frame.GetTexture C# (CSharp) Méthode

GetTexture() public méthode

Gets a texture representing this SPR2Frame.
public GetTexture ( GraphicsDevice device ) : Microsoft.Xna.Framework.Graphics.Texture2D
device GraphicsDevice GraphicsDevice instance used for drawing.
Résultat Microsoft.Xna.Framework.Graphics.Texture2D
        public Texture2D GetTexture(GraphicsDevice device)
        {
            DecodeIfRequired();
            if (PixelCache == null)
            {
                if (this.Width == 0 || this.Height == 0)
                {
                    return null;
                }
                PixelCache = new Texture2D(device, this.Width, this.Height);
                PixelCache.SetData<Color>(this.PixelData);
                if (!IffFile.RETAIN_CHUNK_DATA) PixelData = null;
            }
            return PixelCache;
        }