1 package de.lathanda.eos.robot.gui;
4 import java.util.HashMap;
5 import java.util.LinkedList;
7 import com.jogamp.opengl.GL;
8 import com.jogamp.opengl.GL2;
10 import de.lathanda.eos.robot.geom3d.Polyhedron;
14 private static HashMap<Polyhedron, GLObjectBuffer> objbuffer =
new HashMap<>();
19 objbuffer.put(poly, obj);
23 public static synchronized void clear(GL gl) {
31 private HashMap<GL , LinkedList<GLRenderObject> > robuffer =
new HashMap<>();
37 LinkedList<GLRenderObject> ro = robuffer.get(gl);
40 ro.forEach( r->r.destroy(gl));
44 public void render(Color base, GL2 gl) {
45 LinkedList<GLRenderObject> ro = robuffer.get(gl);
47 ro =
new LinkedList<>();
48 final boolean VBOsupported = gl.isFunctionAvailable(
"glGenBuffersARB") &&
49 gl.isFunctionAvailable(
"glBindBufferARB") &&
50 gl.isFunctionAvailable(
"glBufferDataARB") &&
51 gl.isFunctionAvailable(
"glDeleteBuffersARB");
55 ro =
new LinkedList<>();
60 ro.forEach( r -> r.render(gl, base));
void render(Color base, GL2 gl)
static synchronized void clear(GL gl)
static LinkedList< GLRenderObject > create(Polyhedron poly)