Skip to content

Commit a98c73e

Browse files
committed
Engine: pointer overloads for texture(), addChild(PShape*), shader(PShader*)
Processing.h: - texture(PImage*) pointer overload - addChild(const PShape*) pointer overload - shader(PShader*) pointer overload (Problem 2.2 complete)
1 parent 1354c64 commit a98c73e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/Processing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,6 +3050,7 @@ class PShape {
30503050
void endShape(bool close=false) { closed=close; }
30513051
void vertex(float x,float y,float z=0,float u=0,float v=0) { verts.push_back({x,y,z,u,v}); }
30523052
void addChild(const PShape& s) { children.push_back(s); }
3053+
void addChild(const PShape* s) { if (s) addChild(*s); }
30533054
std::string name; // id/name attribute from SVG
30543055
std::vector<int> subpathStarts; // subpath start indices for multi-part fills
30553056
std::vector<Vertex> anchorVerts; // raw anchor points (M/L/C endpoints only) for getVertex()
@@ -3986,6 +3987,7 @@ struct PApplet {
39863987
void textureMode(int mode);
39873988
void textureWrap(int mode);
39883989
void texture(PImage& img);
3990+
void texture(PImage* img) { if (img) texture(*img); }
39893991

39903992
// ── Shader ───────────────────────────────────────────────────────────────
39913993
PShader* loadShader(const std::string& fragPath, const std::string& vertPath="");

0 commit comments

Comments
 (0)