29 lines
740 B
C#
29 lines
740 B
C#
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 IQuikTexture 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();
|
|
}
|
|
}
|
|
}
|