We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70cab45 commit f39d1baCopy full SHA for f39d1ba
crates/processing_render/src/lib.rs
@@ -293,15 +293,15 @@ pub fn init(config: Config) -> error::Result<()> {
293
294
/// Initialize the app asynchronously
295
#[cfg(target_arch = "wasm32")]
296
-pub async fn init() -> error::Result<()> {
+pub async fn init(config: Config) -> error::Result<()> {
297
use bevy::app::PluginsState;
298
299
setup_tracing()?;
300
if is_already_init()? {
301
return Ok(());
302
}
303
304
- let mut app = create_app();
+ let mut app = create_app(config);
305
306
// we need to avoid blocking the main thread while waiting for plugins to initialize
307
while app.plugins_state() == PluginsState::Adding {
crates/processing_wasm/src/lib.rs
@@ -2,9 +2,10 @@
2
3
use bevy::prelude::Entity;
4
use processing_render::{
5
- exit, graphics_begin_draw, graphics_end_draw, graphics_flush, graphics_record_command,
6
- image_create, image_destroy, image_load, image_readback, image_resize, init,
7
- render::command::DrawCommand, surface_create_from_canvas, surface_destroy, surface_resize,
+ config::Config, exit, graphics_begin_draw, graphics_end_draw, graphics_flush,
+ graphics_record_command, image_create, image_destroy, image_load, image_readback, image_resize,
+ init, render::command::DrawCommand, surface_create_from_canvas, surface_destroy,
8
+ surface_resize,
9
};
10
use wasm_bindgen::prelude::*;
11
@@ -19,7 +20,8 @@ fn wasm_start() {
19
20
21
#[wasm_bindgen(js_name = "init")]
22
pub async fn js_init() -> Result<(), JsValue> {
- check(init().await)
23
+ let config = Config::new();
24
+ check(init(config).await)
25
26
27
#[wasm_bindgen(js_name = "createSurface")]
0 commit comments