aboutsummaryrefslogtreecommitdiffstats
path: root/src/ru/olamedia/geom/DisplayList.java
blob: aeaffc7f0c7a6b1da39a52250f122248b803869d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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();
	}
}