You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The entry point to most WebGL code is through **p5.RendererGL**. Top-level p5.js functions are passed to the current renderer. Both 2D and WebGL modes have renderer classes that conform to a common `p5.Renderer` interface. Immediate mode and retained mode functions are split up into `p5.RendererGL.Immediate.js` and `p5.RendererGL.Retained.js`.
259
253
260
254
Within the renderer, references to models are stored in the `retainedMode.geometry` map. Each value is an object storing the buffers of a `p5.Geometry` When calling `model(yourGeometry)` for the first time, the renderer adds an entry in the map. It then stores references to the geometry's GPU resources there. If you draw a `p5.Geometry` to the main canvas and also to a WebGL `p5.Graphics`, it will have entries in two renderers.
@@ -44,6 +45,17 @@ Before you begin you should be able to:
44
45
45
46
For a step-by-step guide to creating and saving projects in the [p5.js Web Editor](https://editor.p5js.org/) or [VS Code](https://code.visualstudio.com/), visit [Setting Up Your Environment](../setting-up-your-environment).
46
47
48
+
# Mermaid test
49
+
50
+
<divclassName="mermaid">
51
+
{String.raw`flowchart TD
52
+
A[Start] --> B{Build-time Mermaid?}
53
+
B -- Yes --> C[Inline SVG ✅]
54
+
B -- No --> D[Code block ❌]
55
+
`}
56
+
</div>
57
+
58
+
47
59
48
60
## Step 1: Name and save a new p5.js project
49
61
@@ -77,6 +89,7 @@ function setup() {
77
89
functiondraw() {
78
90
background(220);
79
91
}
92
+
80
93
```
81
94
82
95
Every sketch.js file begins with two main functions: [`setup()`](/reference/p5/setup) and [`draw()`](/reference/p5/draw).
0 commit comments