using System; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; namespace NW4RTools.Models.OpenGL { public class GLDisplayList : IDisposable { public readonly int ListID; public GLDisplayList() { ListID = GL.GenLists(1); } void IDisposable.Dispose() { GL.DeleteLists(ListID, 1); } public void Begin() { GL.NewList(ListID, ListMode.Compile); } public void End() { GL.EndList(); } public void Execute() { GL.CallList(ListID); } } }