ResourceManager!
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
using DaggerFramework.Resources;
|
||||
using StbImageSharp;
|
||||
|
||||
namespace DaggerFramework
|
||||
{
|
||||
public class Texture2dLoader : ResourceLoader<Texture2d>
|
||||
public class Texture2dLoader : IResourceLoader
|
||||
{
|
||||
public override Texture2d Load(string path)
|
||||
public IEnumerable<string> SupportedExtensions => new string[]
|
||||
{
|
||||
".png",
|
||||
".jpg",
|
||||
".jpeg"
|
||||
};
|
||||
|
||||
public Type ResourceType => typeof(Texture2d);
|
||||
|
||||
public Resource Load(string path)
|
||||
{
|
||||
ImageResult image;
|
||||
using (var stream = File.OpenRead(path))
|
||||
@@ -18,5 +28,10 @@ namespace DaggerFramework
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Resource IResourceLoader.Load(string path)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user