You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emscripten builds cannot create multiple windows because the code is written as if there will only be one canvas element in the document. I've looked into the code and believe these tasks needed to fix this issue:
Register callbacks that don't take an element as a parameter (i.e. emscripten_set_fullscreenchange_callback, emscripten_set_focus_callback, Emscripten_set_pointer_event_callbacks) during initialization. These callbacks should look through all of the canvases in the document and only handle the event for the focused canvas.
Update Emscripten_UpdateWindowFramebuffer to store multiple canvases and update the specified canvas based on the window_id of the window. This will only fix the software renderer.
For the opengles2 renderer, there are a few possibilities:
Update Emscripten such that a specific canvas can be set as the target canvas. Currently, Emscripten only renders to Module['canvas']
Update SDL so that it updates Module['canvas'] to the canvas of the renderer before any render calls.
Implement SDL_gpu with WebGL (or WebGPU) and ensure the correct canvas is being rendered to. Then, gpu would be the default renderer for Emscripten builds. If the opengles2 is used, return an error if multiple windows are attempted to be made and suggest using the gpu renderer.
The text was updated successfully, but these errors were encountered:
Based on my experience with Emscripten and HTML5 canvases, since contexts are bound to their canvas like renderers to their window, I would find it more intuitive if one SDL window == one HTML5 canvas, and disallow (or, if possible, implement in a dedicated function) the dynamic change of which canvas is bound to a window.
Emscripten builds cannot create multiple windows because the code is written as if there will only be one canvas element in the document. I've looked into the code and believe these tasks needed to fix this issue:
Remove Emscripten hints and make them propertiesAdd create window properties to be overrides for hints(emscripten: move hints to window properties #12509 )emscripten_set_fullscreenchange_callback
,emscripten_set_focus_callback
,Emscripten_set_pointer_event_callbacks
) during initialization. These callbacks should look through all of the canvases in the document and only handle the event for the focused canvas.Emscripten_UpdateWindowFramebuffer
to store multiple canvases and update the specified canvas based on thewindow_id
of the window. This will only fix the software renderer.For the opengles2 renderer, there are a few possibilities:
Module['canvas']
Module['canvas']
to the canvas of the renderer before any render calls.The text was updated successfully, but these errors were encountered: