Configure hello example to run it in the web browser too#55
Configure hello example to run it in the web browser too#55MarcAntoine-Arnaud wants to merge 2 commits intohecrj:masterfrom
Conversation
| } | ||
| } | ||
|
|
||
| async fn run(event_loop: EventLoop<()>, window: Window) { |
There was a problem hiding this comment.
Why have we introduced async at the top level here?
It looks like we are not awaiting anywhere. In fact, we are running block_on inside a Future which is forbidden by contract.
There was a problem hiding this comment.
async is required for wasm_bindgen_futures::spawn_local, it's inspired from Wgpu-rs Hello triangle example.
So I have remove the futures::executor::block_on that's not necessary anymore.
|
|
||
| [dependencies] | ||
| wgpu = "0.7" | ||
| wgpu = {version = "0.7", features = ["webgl"]} |
There was a problem hiding this comment.
I wasn't aware that wgpu supported WebGL now! That's very good news!
|
|
||
| [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] | ||
| pollster = "0.2" | ||
| wgpu-subscriber = "0.1" |
There was a problem hiding this comment.
What does wgpu-subscriber do exactly? Does it replace env_logger?
There was a problem hiding this comment.
Yes and it's a pretty logger for web env, and more for Chrome as some code is dedicated to that browser.
In Chrome you can select log level, that wgpu-subscriber detect and print the right log level.
|
@hecrj ping |
|
@MarcAntoine-Arnaud May I ask how this example is run? Following the directions mentioned in wgpu-rs's wiki, just modified for your branch, doesn't seem to work; I get errors in Firefox Nightly about |
|
Hello @smolck, I have tested on Chrome and it works. |
No description provided.