Skip to content

Commit 1395f32

Browse files
committed
cleaning up curve/bezier drawing, vertex() functions, and separation of
PGraphics, P2D, and P3D.
1 parent 47834dc commit 1395f32

8 files changed

Lines changed: 737 additions & 685 deletions

File tree

core/api.txt

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,57 @@ style(PStyle s)
2727

2828
//
2929

30-
setParent()
31-
setPrimary()
32-
setPath()
33-
setSize(int w, int h)
34-
allocate()
30+
public void setParent(PApplet parent)
31+
public void setPrimary(boolean primary)
32+
public void setPath(String path)
33+
public void setSize(int iwidth, int iheight)
34+
protected void allocate()
3535

36-
canDraw()
37-
beginDraw()
38-
endDraw()
39-
flush()
36+
public boolean canDraw()
37+
public void beginDraw()
38+
public void endDraw()
39+
public void flush()
4040

41-
checkSettings()
42-
defaultSettings()
43-
reapplySettings()
41+
protected void checkSettings()
42+
protected void defaultSettings()
43+
protected void reapplySettings()
4444

45-
hint()
45+
public void hint(int which)
4646

4747
public void beginShape()
4848
public void beginShape(int kind)
49+
public void edge(boolean e)
4950
public void normal(float nx, float ny, float nz)
5051
public void textureMode(int mode)
5152
public void texture(PImage image)
5253
public void vertex(float x, float y)
5354
public void vertex(float x, float y, float z)
5455
public void vertex(float x, float y, float u, float v)
5556
public void vertex(float x, float y, float z, float u, float v)
57+
protected void vertexTexture(float u, float v);
58+
public void breakShape()
59+
public void endShape()
60+
public void endShape(int mode)
61+
62+
protected void bezierVertexCheck();
5663
public void bezierVertex(float x2, float y2,
5764
float x3, float y3,
5865
float x4, float y4)
5966
public void bezierVertex(float x2, float y2, float z2,
6067
float x3, float y3, float z3,
6168
float x4, float y4, float z4)
69+
70+
protected void curveVertexCheck();
6271
public void curveVertex(float x, float y)
6372
public void curveVertex(float x, float y, float z)
64-
public void breakShape()
65-
public void endShape()
66-
public void endShape(int mode)
73+
protected void curveVertexSegment(float x1, float y1,
74+
float x2, float y2,
75+
float x3, float y3,
76+
float x4, float y4)
77+
protected void curveVertexSegment(float x1, float y1, float z1,
78+
float x2, float y2, float z2,
79+
float x3, float y3, float z3,
80+
float x4, float y4, float z4)
6781

6882
public void point(float x, float y)
6983
public void point(float x, float y, float z)

core/src/processing/core/PApplet.java

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6661,6 +6661,12 @@ public void updatePixels(int x1, int y1, int x2, int y2) {
66616661
// public functions for processing.core
66626662

66636663

6664+
public void flush() {
6665+
if (recorder != null) recorder.flush();
6666+
g.flush();
6667+
}
6668+
6669+
66646670
public void hint(int which) {
66656671
if (recorder != null) recorder.hint(which);
66666672
g.hint(which);
@@ -6679,6 +6685,12 @@ public void beginShape(int kind) {
66796685
}
66806686

66816687

6688+
public void edge(boolean e) {
6689+
if (recorder != null) recorder.edge(e);
6690+
g.edge(e);
6691+
}
6692+
6693+
66826694
public void normal(float nx, float ny, float nz) {
66836695
if (recorder != null) recorder.normal(nx, ny, nz);
66846696
g.normal(nx, ny, nz);
@@ -6721,6 +6733,24 @@ public void vertex(float x, float y, float z, float u, float v) {
67216733
}
67226734

67236735

6736+
public void breakShape() {
6737+
if (recorder != null) recorder.breakShape();
6738+
g.breakShape();
6739+
}
6740+
6741+
6742+
public void endShape() {
6743+
if (recorder != null) recorder.endShape();
6744+
g.endShape();
6745+
}
6746+
6747+
6748+
public void endShape(int mode) {
6749+
if (recorder != null) recorder.endShape(mode);
6750+
g.endShape(mode);
6751+
}
6752+
6753+
67246754
public void bezierVertex(float x2, float y2,
67256755
float x3, float y3,
67266756
float x4, float y4) {
@@ -6749,24 +6779,6 @@ public void curveVertex(float x, float y, float z) {
67496779
}
67506780

67516781

6752-
public void breakShape() {
6753-
if (recorder != null) recorder.breakShape();
6754-
g.breakShape();
6755-
}
6756-
6757-
6758-
public void endShape() {
6759-
if (recorder != null) recorder.endShape();
6760-
g.endShape();
6761-
}
6762-
6763-
6764-
public void endShape(int mode) {
6765-
if (recorder != null) recorder.endShape(mode);
6766-
g.endShape(mode);
6767-
}
6768-
6769-
67706782
public void style(PStyle s) {
67716783
if (recorder != null) recorder.style(s);
67726784
g.style(s);

0 commit comments

Comments
 (0)