using System.Collections.Generic; using OpenTK.Graphics.OpenGL4; namespace Quik.OpenTK { public class OpenGLTextureManager : IQuikTextureManager { public QuikContext Context { get; set; } private List _reclaimList = new List(); public QuikTexture CreateTexture(QuikVec2 size, bool mipmaps, QuikImageFormat format) { return new OpenGLTexture(this, format, size, mipmaps); } internal void Reclaim(OpenGLTexture texture) { _reclaimList.Add(texture.TextureId); } public void Clear() { GL.DeleteTextures(_reclaimList.Count, _reclaimList.ToArray()); _reclaimList.Clear(); } } }