namespace Engine.Resource.Loader;

public class TextureLoader : IResourceLoader
{
  public object Load(string parPath, IResourceStreamProvider parStreamProvider)
  {
    using var stream = parStreamProvider.GetStream(parPath);
    var image = ImageLoader.Load(stream);

    // TODO: We should not be using engine instance here
    return Engine.Instance.Renderer.Schedule(() => image.ToStaticTexture()).Result;
  }
}