Skip to content

Commit 0c2ad60

Browse files
committed
Add PShape.beginShape/endShape for programmatic shape building
1 parent c5d700d commit 0c2ad60

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Processing.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,7 +3437,11 @@ class PShape {
34373437

34383438
void beginShape(int k=-1) { kind=k; verts.clear(); }
34393439
void endShape(bool close=false) { closed=close; }
3440+
void beginShape(int kind=0) { kind_=kind; verts.clear(); }
3441+
void endShape(int mode=0) { closed_=(mode==CLOSE); }
34403442
void vertex(float x,float y,float z=0,float u=0,float v=0) { verts.push_back({x,y,z,u,v}); }
3443+
int kind_ = 0;
3444+
bool closed_ = true;
34413445
void addChild(const PShape& s) { children.push_back(s); }
34423446
void addChild(const PShape* s) { if (s) addChild(*s); }
34433447
::std::string name; // id/name attribute from SVG

0 commit comments

Comments
 (0)