Skip to content

Commit 492150f

Browse files
committed
Processing_api.h: use ::Processing::_api namespace for zero-maintenance forwarders
1 parent 3b1a729 commit 492150f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/Processing_api.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// Processing_api.h
22
// Included in user-defined classes that don't inherit from PApplet.
3-
// Brings all Processing free functions into scope via using directive.
4-
// Sketch state variables (width, height, mouseX, etc.) are accessible
5-
// through the inline accessors below.
3+
// Exposes all Processing API functions via using directives.
4+
// Zero maintenance: add functions to _api namespace, they appear here automatically.
65
#pragma once
76
#include "Processing.h"
87
#include <string>
98

109
using namespace ::Processing;
10+
using namespace ::Processing::_api;
1111

12-
// ── Sketch state accessors ────────────────────────────────────────────────────
13-
// These expose PApplet member variables as free functions for hoisted classes.
12+
// ── Sketch state accessors (PApplet member variables) ─────────────────────────
1413
inline int width() { return PApplet::g_papplet ? PApplet::g_papplet->logicalW : 0; }
1514
inline int height() { return PApplet::g_papplet ? PApplet::g_papplet->logicalH : 0; }
1615
inline float mouseX() { return PApplet::g_papplet ? PApplet::g_papplet->mouseX : 0.f; }

0 commit comments

Comments
 (0)