-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to return from the event loop #900
Comments
See prior discussions on the topic: #459 (comment) #459 (comment) explicitly says that throwing exceptions is the intended design. |
Throwing exceptions is indeed the intended design. It's not particularly pretty, but it's the only API I'm aware of that behaves mostly identically on all platforms. |
Seems like a reasonable approach would be to offer both methods. Since WebAssembly initialization tends to require platform-specific tweaks anyway (i.e. for resource loading, since standard filesystem APIs aren't available), most programs targeting a There is one additional concern that was mentioned briefly but may require further analysis: at least according to the (Then again, since the user would be expecting |
If we're exposing |
This is covered by Fixed by #2208. |
Currently we have #797 and #845 working on bringing in webassembly support. Unfortunately, in the browser we have to return from function calls. These backends both have to rely on throwing exceptions as control flow in order to break out of the loop.
Is there a way winit could provide some mechanisms for loops that work this way? I noticed some of the other backends implement a
run_return
function that is usually called byrun
; perhaps winit could standardize on this?The text was updated successfully, but these errors were encountered: