(strandsContext, name)
| 77 | } |
| 78 | |
| 79 | function 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 | |
| 99 | function installBuiltinGlobalAccessors(strandsContext) { |
| 100 | if (strandsContext._builtinGlobalsAccessorsInstalled) return |
no test coverage detected