Dashboard/Quik.OpenTK/OpenGLTextureManager.cs

29 lines
739 B
C#
Raw Normal View History

2022-08-20 11:57:57 +02:00
using System.Collections.Generic;
using OpenTK.Graphics.OpenGL4;
namespace Quik.OpenTK
{
public class OpenGLTextureManager : IQuikTextureManager
{
public QuikContext Context { get; set; }
private List<int> _reclaimList = new List<int>();
public QuikTexture CreateTexture(QuikVec2 size, bool mipmaps, QuikImageFormat format)
2022-08-20 11:57:57 +02:00
{
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();
}
}
}