FerretEngine/src/Content/FeContent.cs
/// <summary>
/// Loads a raw PNG image from the Content directory as a <see cref="Texture2D"/>.
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
Loads a raw PNG image from the Content directory as a .
Loads a raw PNG image from the Content directory as a .
public static Texture2D LoadTexture(string path)
        {
            Texture2D texture;
            path = CheckFilename(path, ".png");
            using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
            {
                texture = Texture2D.FromStream(FeGame.Instance.GraphicsDevice, fileStream);
            }
            return texture;
        }
public static Texture2D LoadTexture ( string path ) { Texture2D texture ; path = CheckFilename ( path , " " ) ; using ( var fileStream = new FileStream ( path , FileMode . Open , FileAccess . Read ) ) { texture = Texture2D . FromStream ( FeGame . Instance . GraphicsDevice , fileStream ) ; } return texture ; }
Loads a raw PNG image from the Content directory as a .
Loads a raw PNG image from the Content directory as a .
None
path
string
None