hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
11.13k stars 665 forks source link

Use offscreen canvas if the global scope is worker #1064

Open hajimehoshi opened 4 years ago

hajimehoshi commented 4 years ago

https://developers.google.com/web/updates/2018/08/offscreen-canvas https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas

If Ebiten can work on a worker, multiple Ebiten instances can work in theory.

hajimehoshi commented 4 years ago

We need to have API to pass an (offscreen) canvas. maybe.

hajimehoshi commented 3 years ago

https://caniuse.com/offscreencanvas

Only Chrome (and Edge) support this.

superloach commented 2 years ago

OffscreenCanvas landed in Firefox 105, still only at 73% usage though. Although it's not the worst to expect users to use a fairly new browser for a feature like this.

hajimehoshi commented 1 year ago

https://caniuse.com/offscreencanvas Now most modern browsers support this

EDIT: The latest Safari doesn't support it yet.

hajimehoshi commented 1 year ago

In workers, inputting would not work, but probably this is fine...