# How to create two canvases to run separate WebGL app

**URL:** <https://discourse.processing.org/t/how-to-create-two-canvases-to-run-separate-webgl-app/18304>\
**Category:** Coding Questions\
**Created:** [March 2, 2020, 9:25am UTC](https://discourse.processing.org/t/how-to-create-two-canvases-to-run-separate-webgl-app/18304 "2020-03-02T09:25:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zyhllr](https://avatars.discourse-cdn.com/v4/letter/z/e68b1a/32.png) [@zyhllr](https://discourse.processing.org/u/zyhllr)\
**Post date:** [March 2, 2020, 9:25am UTC](https://discourse.processing.org/t/how-to-create-two-canvases-to-run-separate-webgl-app/18304/1 "2020-03-02T09:25:50Z")

</div>

How to create two cnavas to run separate WebGL app

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [March 4, 2020, 2:50pm UTC](https://discourse.processing.org/t/how-to-create-two-canvases-to-run-separate-webgl-app/18304/2 "2020-03-04T14:50:36Z")

</div>

In first one use [launch()](https://processing.org/reference/launch_.html) to call the second

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 6, 2020, 7:48pm UTC](https://discourse.processing.org/t/how-to-create-two-canvases-to-run-separate-webgl-app/18304/3 "2020-03-06T19:48:45Z")

</div>

@matheplica – `launch()` is only available for Processing (Java). It doesn’t work for p5.js (JavaScript) and WebGL.

@zyhllr – should the canvases be communicating? does one control the other? You can create multiple canvases in several ways, but the basic approach is to namespace each canvas with “instance mode.”

[https://www.google.com/search?q=p5.js+instance+mode](https://www.google.com/search?q=p5.js+instance+mode)
