-
Notifications
You must be signed in to change notification settings - Fork 64
We cannot change canvas' id #130
Comments
Ah, An easier solution for using one window/canvas with a non-default id might be to add a |
I've recently started fiddling with emscripten myself and bumped into this issue for a different reason. In my case, I want to embed some emscripten code in my wordpress blog but the pages themselves actually use a canvas with the id "canvas" so it hasn't gone well. Is there any fix/tweak for this in site? |
Changing that one line should be enough for the SDL side. I haven't looked at it in a while though. |
Hey, just coming by to confirm that this worked for me. Did have to hard-code to the alternative ID I've settled for, though, as I couldn't figure out how to get the expected behaviour of it asking Module for the canvas (then again, this is very new to me and I didn't look super deep into it). So, for me the workaround is acceptable and I did manage to get a couple demos for my blog, integrated decently enough like this WebGL Mandelbox Thanks a lot for the help |
I was having this same problem. I just compiled with
|
emscripten-ports/SDL2#130 and allow us to put multiple Modules (and canvases) on one page without having to use <iframe>s
I would like to use two canvas on my page so my idea is to instanciate the wasm twice. The problem is that the canvas's ID seems hardcoded in the SDL port, so the canvas size is not well handled: both instances are controling the same canvas even if I pass a different HTML canvas on the module initialization.
SDL2/src/video/emscripten/SDL_emscriptenvideo.c
Line 217 in 8424e3c
Would it be a way to make it dynamic?
The text was updated successfully, but these errors were encountered: