wgpu + egui 0.20.0
android broken but let's just fix it on the egui/winit side once that's all updated
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
||||
use damus::Damus;
|
||||
use eframe;
|
||||
use log::info;
|
||||
|
||||
// Entry point for wasm
|
||||
//#[cfg(target_arch = "wasm32")]
|
||||
//use wasm_bindgen::prelude::*;
|
||||
|
||||
// Desktop
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
@@ -17,20 +22,22 @@ fn main() {
|
||||
);
|
||||
}
|
||||
|
||||
// Web
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
// Make sure panics are logged using `console.error`.
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
// Redirect tracing to console.log and friends:
|
||||
tracing_wasm::set_as_global_default();
|
||||
|
||||
let web_options = eframe::WebOptions::default();
|
||||
eframe::start_web(
|
||||
"the_canvas_id", // hardcode it
|
||||
web_options,
|
||||
Box::new(|_cc| Box::new(Damus::new())),
|
||||
)
|
||||
.expect("failed to start eframe");
|
||||
wasm_bindgen_futures::spawn_local(async {
|
||||
let web_options = eframe::WebOptions::default();
|
||||
eframe::start_web(
|
||||
"the_canvas_id", // hardcode it
|
||||
web_options,
|
||||
Box::new(|_cc| Box::new(Damus::new())),
|
||||
)
|
||||
.await
|
||||
.expect("failed to start eframe");
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user