Small ResourceManager refactor, add ResourceSaver<T>.

This commit is contained in:
2024-01-21 20:24:53 +01:00
parent cfec5a59b1
commit 62e0e013f1
16 changed files with 215 additions and 54 deletions

View File

@@ -3,7 +3,7 @@ using StbImageSharp;
namespace DaggerFramework
{
public class Texture2dLoader : IResourceLoader
public class Texture2dLoader : IResourceLoader<Texture2d>
{
public IEnumerable<string> SupportedExtensions => new string[]
{
@@ -12,9 +12,7 @@ namespace DaggerFramework
".jpeg"
};
public Type ResourceType => typeof(Texture2d);
public Resource Load(string path)
public Texture2d Load(string path)
{
ImageResult image;
using (var stream = File.OpenRead(path))
@@ -28,10 +26,5 @@ namespace DaggerFramework
return result;
}
Resource IResourceLoader.Load(string path)
{
throw new NotImplementedException();
}
}
}