summaryrefslogtreecommitdiff
path: root/NW4RTools/Models/OpenGL/GLDisplayList.cs
diff options
context:
space:
mode:
Diffstat (limited to 'NW4RTools/Models/OpenGL/GLDisplayList.cs')
-rw-r--r--NW4RTools/Models/OpenGL/GLDisplayList.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/NW4RTools/Models/OpenGL/GLDisplayList.cs b/NW4RTools/Models/OpenGL/GLDisplayList.cs
new file mode 100644
index 0000000..180e89e
--- /dev/null
+++ b/NW4RTools/Models/OpenGL/GLDisplayList.cs
@@ -0,0 +1,31 @@
+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);
+ }
+ }
+}
+