go-p5 / p5

p5 is a simple package that provides primitives resembling the ones exposed by p5js.org
https://go-p5.github.io/
BSD 3-Clause "New" or "Revised" License
146 stars 12 forks source link

Questions About specific stuff #46

Closed nonunknown closed 3 years ago

nonunknown commented 3 years ago

I tried run p5 while doing other stuff like this:

image basically, in this situation the p5 window doesnt run, there's a way to run it, while listening to connections?

I tried running it in concurrency mode: image but didnt worked.

The Second question is: How to Run it on browser using gorilla?

sbinet commented 3 years ago

the p5.Run function is kind of a "high-level" API. for the kind of things you seem to want to achieve, you'll probably have to drop to the p5.Proc API.

that said, go-p5 is built on top of Gio which supports WASM. so, instead of having go-p5 run server-side (and then, somehow sending back the image to the client), one could compile the p5.Run(setup, draw) part to a WASM binary and serve that via net/http or Gorilla like any other JS resource.

sbinet commented 3 years ago

I've just added a simple example:

let me know.