using System; namespace Quik { /// /// Interface for texture instances. /// public abstract class QuikTexture : IEquatable, IDisposable { /// /// Width of the texture. /// public abstract int Width { get; } /// /// Height of the texture. /// public abstract int Height { get; } /// /// True if the texture can have mipmaps. /// public abstract bool Mipmaps { get; } /// /// Indicates whether this texture contains a signed distance field. /// public bool SignedDistanceField { get; set; } /// /// Indicates whether this texture has premultiplied alpha. /// public bool PreMultipled { get; set; } /// /// Upload texture data. /// /// Pointer to data. /// Color format of the data. /// Size of the texture data. /// Mip level. /// Pixel alignment. Expected to be 1, 2, 4, or 8. public abstract void Image(IntPtr data, QuikImageFormat format, QVec2 size, int level, int alignment = 4); /// /// Upload texture data. /// /// Pointer to data. /// Color format for the data. /// Location of the data in the texture. /// Mip level. /// Pixel alignment. Expected to be 1, 2, 4, or 8. public abstract void SubImage(IntPtr data, QuikImageFormat format, QRectangle location, int level, int alignment = 4); /// /// Generate the mip maps for the texture. /// public abstract void GenerateMipMaps(); public virtual bool Equals(QuikTexture other) { return base.Equals(other); } public void Dispose() => Dispose(true); protected virtual void Dispose(bool isDisposing) { } } }