tessellator object is static

This commit is contained in:
codeanticode
2012-05-04 21:04:28 +00:00
parent 42ef5f5e06
commit 8143cf37e4
2 changed files with 12 additions and 6 deletions

View File

@@ -182,7 +182,7 @@ public class PGraphicsOpenGL extends PGraphics {
protected int firstTexIndex;
protected int firstTexCache;
protected TexCache texCache;
protected Tessellator tessellator;
static protected Tessellator tessellator;
// ........................................................
@@ -388,7 +388,9 @@ public class PGraphicsOpenGL extends PGraphics {
pgl = new PGL(this);
pg = null;
tessellator = new Tessellator();
if (tessellator == null) {
tessellator = new Tessellator();
}
inGeo = newInGeometry(IMMEDIATE);
tessGeo = newTessGeometry(IMMEDIATE);
@@ -6780,7 +6782,11 @@ public class PGraphicsOpenGL extends PGraphics {
void disposeTessMap() {
tessMap.dispose();
}
void compactTessMap() {
tessMap.compact();
}
// -----------------------------------------------------------------
//
// Query

View File

@@ -269,7 +269,7 @@ public class PShape3D extends PShape {
glPointSizeBufferID = 0;
glPointIndexBufferID = 0;
this.tessellator = pg.tessellator;
this.tessellator = PGraphicsOpenGL.tessellator;
this.family = family;
this.root = this;
this.parent = null;
@@ -277,7 +277,7 @@ public class PShape3D extends PShape {
if (family == GEOMETRY || family == PRIMITIVE || family == PATH) {
inGeo = pg.newInGeometry(PGraphicsOpenGL.RETAINED);
}
}
// Modes are retrieved from the current values in the renderer.
textureMode = pg.textureMode;
@@ -2526,7 +2526,7 @@ public class PShape3D extends PShape {
tessGeo.applyMatrix(matrix);
}
inGeo.tessMap.compact();
inGeo.compactTessMap();
}
}