breakShape() replaced by beginContour()/endCountour()

This commit is contained in:
codeanticode
2011-12-11 14:16:20 +00:00
parent 4a546bbb9a
commit b57bbdb476
2 changed files with 35 additions and 4 deletions

View File

@@ -460,7 +460,8 @@ public class PGraphicsOpenGL extends PGraphics {
protected float[] currentTexcoord = { 0, 0 };
protected float[] currentStroke = { 0, 0, 0, 1, 1 };
protected boolean breakShape;
protected boolean openContour = false;
protected boolean breakShape = false;
public static int flushMode = FLUSH_WHEN_FULL;
// public static int flushMode = FLUSH_AFTER_SHAPE;
@@ -1882,7 +1883,21 @@ public class PGraphicsOpenGL extends PGraphics {
}
public void breakShape() {
public void beginContour() {
if (openContour) {
showWarning("P3D: Already called beginContour().");
return;
}
openContour = true;
}
public void endContour() {
if (!openContour) {
showWarning("P3D: Need to call beginContour() first.");
return;
}
openContour = false;
breakShape = true;
}

View File

@@ -118,10 +118,12 @@ public class PShape3D extends PShape {
// Drawing/rendering state
protected boolean modified;
protected boolean breakShape;
protected boolean isSolid;
protected boolean isClosed;
protected boolean openContour = false;
protected boolean breakShape = false;
protected boolean hasFill;
protected boolean hasLines;
protected boolean hasPoints;
@@ -297,7 +299,21 @@ public class PShape3D extends PShape {
}
public void breakShape() {
public void beginContour() {
if (openContour) {
PGraphics.showWarning("P3D: Already called beginContour().");
return;
}
openContour = true;
}
public void endContour() {
if (!openContour) {
PGraphics.showWarning("P3D: Need to call beginContour() first.");
return;
}
openContour = false;
breakShape = true;
}