using StbImageSharp; namespace DaggerFramework { public class Texture2dLoader : ResourceLoader { public override Texture2d Load(string path) { ImageResult image; using (var stream = File.OpenRead(path)) { image = ImageResult.FromStream(stream, ColorComponents.RedGreenBlueAlpha); } Texture2d result = new Texture2d(path, image.Data); result.Width = image.Width; result.Height = image.Height; return result; } } }