Merge branch 'master' into explicit-text-caching
This commit is contained in:
commit
b8e5693a30
178 changed files with 1768 additions and 1388 deletions
|
|
@ -6,19 +6,18 @@ edition = "2021"
|
|||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced_winit = { path = "../../winit" }
|
||||
iced_wgpu = { path = "../../wgpu" }
|
||||
iced_widget = { path = "../../widget" }
|
||||
iced_renderer = { path = "../../renderer", features = ["wgpu"] }
|
||||
env_logger = "0.10"
|
||||
iced_winit.workspace = true
|
||||
iced_wgpu.workspace = true
|
||||
iced_widget.workspace = true
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
tracing-subscriber = "0.3"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
console_error_panic_hook = "0.1.7"
|
||||
console_log = "0.2.0"
|
||||
log = "0.4"
|
||||
iced_wgpu.workspace = true
|
||||
iced_wgpu.features = ["webgl"]
|
||||
|
||||
console_error_panic_hook = "0.1"
|
||||
console_log = "1.0"
|
||||
wasm-bindgen = "0.2"
|
||||
web-sys = { version = "0.3", features = ["Element", "HtmlCanvasElement", "Window", "Document"] }
|
||||
# This dependency a little bit quirky, it is deep in the tree and without `js` feature it
|
||||
# refuses to work with `wasm32-unknown-unknown target`. Unfortunately, we need this patch
|
||||
# to make it work
|
||||
getrandom = { version = "0.2", features = ["js"] }
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@ A demonstration of how to integrate Iced in an existing [`wgpu`] application.
|
|||
The __[`main`]__ file contains all the code of the example.
|
||||
|
||||
<div align="center">
|
||||
<a href="https://gfycat.com/nicemediocrekodiakbear">
|
||||
<img src="https://thumbs.gfycat.com/NiceMediocreKodiakbear-small.gif">
|
||||
</a>
|
||||
<img src="https://iced.rs/examples/integration.gif">
|
||||
</div>
|
||||
|
||||
You can run it with `cargo run`:
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ use winit::platform::web::WindowBuilderExtWebSys;
|
|||
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
let canvas_element = {
|
||||
console_log::init_with_level(log::Level::Debug)?;
|
||||
console_log::init().expect("Initialize logger");
|
||||
|
||||
std::panic::set_hook(Box::new(console_error_panic_hook::hook));
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
};
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
env_logger::init();
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
// Initialize winit
|
||||
let event_loop = EventLoop::new();
|
||||
|
|
@ -82,7 +82,6 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
futures::futures::executor::block_on(async {
|
||||
let adapter = wgpu::util::initialize_adapter_from_env_or_default(
|
||||
&instance,
|
||||
backend,
|
||||
Some(&surface),
|
||||
)
|
||||
.await
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue