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
When I use PROXY_TO_PTHREAD and OFFSCREENCANVAS_SUPPORT to run a SDL app, the canvas is transferred to the worker and then all operations on the canvas are done by that worker.
GL calls work, however, EGL calls are proxied to the main thread, which can no longer access the canvas and we see this error:
InvalidStateError: Failed to execute 'getContext' on 'HTMLCanvasElement': Cannot get context from a canvas that has transferred its control to offscreen.
I was able to get my app to work by simply removing lines containing if (ENVIRONMENT_IS_PTHREAD) return proxyToMainThread for all functions that start with _egl in the generated file, but I'm not sure this is a general solution, hence no PR.