This repository has been archived by the owner on Feb 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
"screen is not defined" when used with PROXY_TO_PTHREAD #110
Comments
Hmm, there was some discussion on this here #77 and some work on new APIs here emscripten-core/emscripten#9336. The quickest solution is probably to switch to |
Oh nice, glad to see it's being worked on. I'll just use a workaround for now! |
This commits solves the problem but hidden error become visible.
Stacktrace:
|
Yeah, there are still other issues, that one can be fixed with EDIT: The workaround from that issue needs a small tweak ( |
Yes this fixes that problem. Ty. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When compiled with
-s PROXY_TO_PTHREAD=1
, calls toSDL_Init()
fail with the error "screen is not defined".This is important to me because proxying all socket commands through a local websocket server as described here is the only way I can get any networking to work in my project.
Here's my source file, poc.c:
And here's my commands to compile and run:
Open localhost:5000/poc.html in a browser, open the developer console, and you see this error:
From jakogut's comments on this site, it appears that the problem is simply that the screen object is not proxied to the new main thread. Relevant lines from
video/emscripten/SDL_emscriptenvideo.c
:Indeed, the documentation on PROXY_TO_PTHREAD only says that the canvas object is proxied to the new main thread. How can we get
screen
proxied as well? I'm happy to contribute code, just need to be pointed in the right direction!The text was updated successfully, but these errors were encountered: