aboutsummaryrefslogtreecommitdiffstats
path: root/src/ru/olamedia/geom/DisplayList.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ru/olamedia/geom/DisplayList.java')
-rw-r--r--src/ru/olamedia/geom/DisplayList.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/ru/olamedia/geom/DisplayList.java b/src/ru/olamedia/geom/DisplayList.java
new file mode 100644
index 0000000..aeaffc7
--- /dev/null
+++ b/src/ru/olamedia/geom/DisplayList.java
@@ -0,0 +1,39 @@
+package ru.olamedia.geom;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+
+public class DisplayList {
+ private GL2 gl;
+ private int glDL;
+
+ public DisplayList(GL glx) {
+ gl = glx.getGL2();
+ glDL = gl.glGenLists(1);
+ }
+
+ public void start() {
+ gl.glNewList(glDL, GL2.GL_COMPILE);
+ }
+
+ public void stop() {
+ gl.glEndList();
+ }
+
+ public void render() {
+ gl.glCallList(glDL);
+ }
+
+ public void destroy() {
+ gl.glDeleteLists(glDL, 1);
+ }
+
+ public void begin() {
+ start();
+ }
+
+ public void end() {
+ stop();
+ }
+}