aboutsummaryrefslogtreecommitdiffstats
path: root/src/ru/olamedia/geom/DisplayList.java
blob: eb6cf04f50b4841b601d3747463bc6a4e4559807 (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
package ru.olamedia.geom;

import javax.media.opengl.GL;
import javax.media.opengl.GL2;

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();
	}
}