File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
109using 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) ─────────────────────────
1413inline int width () { return PApplet::g_papplet ? PApplet::g_papplet->logicalW : 0 ; }
1514inline int height () { return PApplet::g_papplet ? PApplet::g_papplet->logicalH : 0 ; }
1615inline float mouseX () { return PApplet::g_papplet ? PApplet::g_papplet->mouseX : 0 .f ; }
You can’t perform that action at this time.
0 commit comments