Is it possible to resize a canvas after transferControlToOffscreen() in wasm? #20589
Unanswered
FunnyPixel
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am cross compiling to wasm a multi-threaded rendering engine. Upon spawning render thread we call
emscripten_pthread_attr_settransferredcanvases
which is same as callingtransferControlToOffscreen()
in JS. In runtime a hosting JS code is required to resize the canvas to match a window size requested by the user.For example,calling this:
Throws:
I know we are not allowed to call DOM on a secondary thread (worker) in wasm.I wonder if there is still a way to perform canvas resizing in runtime when rendering in worker and using offscreen framebuffer in C++ or in JavaScript?
Beta Was this translation helpful? Give feedback.
All reactions