mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[simulator/web] Use specialHTMLTargets to allow picking a canvas
This commit is contained in:
@@ -18,4 +18,13 @@ Module["preRun"] = function () {
|
||||
ENV[key] = Module['env'][key];
|
||||
}
|
||||
}
|
||||
/* When figuring up in which DOM element to draw, SDL2/emscripten looks for
|
||||
* an element with an id of "canvas". That's pretty annoying because it pretty
|
||||
* much prevents us from running multiple instances of Epsilon in a single web
|
||||
* page even if Epsilon is built using MODULARIZE=1.
|
||||
* Enters specialHTMLTargets. This is a nifty hack that allows one to override
|
||||
* DOM node lookups made by Emscripten! Using this feature, we can instruct
|
||||
* emscripten to use a custom element when looking for "#canvas".
|
||||
* See https://github.com/emscripten-core/emscripten/pull/10659 */
|
||||
specialHTMLTargets["#canvas"] = Module.canvas;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user