MCPcopy Index your code
hub / github.com/processing/p5.js / getBuiltinGlobalNode

Function getBuiltinGlobalNode

src/strands/strands_api.js:79–97  ·  view source on GitHub ↗
(strandsContext, name)

Source from the content-addressed store, hash-verified

77}
78
79function getBuiltinGlobalNode(strandsContext, name) {
80 const spec = BUILTIN_GLOBAL_SPECS[name];
81 if (!spec) return null;
82
83 const uniformName = `_p5_global_${name}`;
84 const instance = strandsContext.renderer?._pInst || strandsContext.p5?.instance;
85
86 const node = getOrCreateUniformNode(
87 strandsContext,
88 uniformName,
89 spec.typeInfo,
90 () => {
91 return instance ? spec.get(instance) : undefined;
92 }
93 );
94
95 node._originalBuiltinName = name;
96 return node;
97}
98
99function installBuiltinGlobalAccessors(strandsContext) {
100 if (strandsContext._builtinGlobalsAccessorsInstalled) return

Callers 1

Calls 2

getOrCreateUniformNodeFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected