using Engine.Graphics.Pixel;
using OpenTK.Graphics.OpenGL;

namespace Engine.Graphics.Texture;

public class StaticTexture : Texture
{
  private StaticTexture(int parWidth, int parHeight, SizedInternalFormat parFormat) : base(parWidth, parHeight)
  {
    GL.TextureStorage2D(Handle, 1, parFormat, Width, Height);
  }

  public static StaticTexture Create<T>(int parWidth, int parHeight)
    where T : struct, IPixel
  {
    var format = default(T).SizedInternalFormat;
    return new StaticTexture(parWidth, parHeight, format);
  }
}