iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.93k stars 1.18k forks source link

example tour won't build #748

Closed kkharji closed 3 years ago

kkharji commented 3 years ago

Hey, I've downloaded tour source code with the following Cargo.toml

[dependencies]
iced = {git = "https://github.com/hecrj/iced", version = "0.2"}
iced_web = "0.3"
env_logger = "0.8"
dotenv = "0.15.0"

the error I'm getting

Container::new(
    |     ^^^^^^^^^^^^^^ the trait `iced_graphics::backend::Image` is not implemented for `iced_wgpu::backend::Backend`

Any ideas why I'm facing this issue?

Thanks

kkharji commented 3 years ago

Also trying to build it for the web produces everything but when I open the index.html in the browser I get blank page

    rustup run nightly cargo build --package tour --target wasm32-unknown-unknown && wasm-bindgen target/wasm32-unknown-unknown/debug/tour.wasm --out-dir tour --web
Kaiden42 commented 3 years ago

You have to enable the image and debug feature to be able to compile the tour example.

iced = { git = "https://github.com/hecrj/iced", features = ["image", "debug"] }
kkharji commented 3 years ago

thanks a lot @Kaiden42 it did work,

for local however it failed to build or run


MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `iced_wgpu encoder`
    In a set_scissor_rect command
    Invalid ScissorRect parameters

thread 'main' panicked at 'Handling wgpu errors as fatal by default', /home/tami/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.7.0/src/backend/direct.rs:1896:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Any ideas?

yusdacra commented 3 years ago

thanks a lot @Kaiden42 it did work,

for local however it failed to build or run


MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `iced_wgpu encoder`
    In a set_scissor_rect command
    Invalid ScissorRect parameters

thread 'main' panicked at 'Handling wgpu errors as fatal by default', /home/tami/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.7.0/src/backend/direct.rs:1896:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Any ideas?

This looks like the same problem as #738

hecrj commented 3 years ago

Fixed by #818.