Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
None
Description
Emscripten Support
Emscripten supports rendering to multiple <canvas>es.
See http://emscripten-discuss.narkive.com/xnMa9pMA/multiple-canvas-with-emscripten . In short, this is supported by passing the canvas element id to the GL context constructor function.
With the current canvas-as-screen setup this will translate to multiple screens for Qt.
Prototype: https://github.com/msorvig/qt-webassembly-examples/tree/master/emscripten_multiscreen
Qt Work Breakdown
Qt assumes there is single canvas in several locations, for example when creating QScreen objects and OpenGL contexts. The emscripten API supports targeting the "default" (single) canvas, all such usages must be modified to target a specific canvas.
- qtloader.js: User code must be able to specify multiple canvases
- qwasmintegration : Create multiple screens, multiple QWasmEventTranslators, multiple QWasmCompositors
- qwasmwindow: OK
- qwasmscreen: OK
- qwasmfontdatabase: OK
- qwasmeventtranslator: Target a specific canvas when installing event handlers
- qwasmeventdispatcher: OK
- qwasmcompositor: ok ( ? )
- qwasmcursor: Target a specific canvas
- qwasmopenglcontext: Target a specific canvas