Replace iced_web with WebGL support in wgpu 🎉

This commit is contained in:
Héctor Ramón Jiménez 2022-01-28 16:47:50 +07:00
parent 1e3feee3a3
commit 825c7749ff
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
35 changed files with 68 additions and 3474 deletions

View file

@ -3,18 +3,11 @@ use std::fmt;
use std::io;
/// The icon of a window.
#[cfg(not(target_arch = "wasm32"))]
#[derive(Debug, Clone)]
pub struct Icon(iced_winit::winit::window::Icon);
/// The icon of a window.
#[cfg(target_arch = "wasm32")]
#[derive(Debug, Clone)]
pub struct Icon;
impl Icon {
/// Creates an icon from 32bpp RGBA data.
#[cfg(not(target_arch = "wasm32"))]
pub fn from_rgba(
rgba: Vec<u8>,
width: u32,
@ -25,16 +18,6 @@ impl Icon {
Ok(Icon(raw))
}
/// Creates an icon from 32bpp RGBA data.
#[cfg(target_arch = "wasm32")]
pub fn from_rgba(
_rgba: Vec<u8>,
_width: u32,
_height: u32,
) -> Result<Self, Error> {
Ok(Icon)
}
}
/// An error produced when using `Icon::from_rgba` with invalid arguments.
@ -62,7 +45,6 @@ pub enum Error {
OsError(io::Error),
}
#[cfg(not(target_arch = "wasm32"))]
impl From<iced_winit::winit::window::BadIcon> for Error {
fn from(error: iced_winit::winit::window::BadIcon) -> Self {
use iced_winit::winit::window::BadIcon;
@ -86,7 +68,6 @@ impl From<iced_winit::winit::window::BadIcon> for Error {
}
}
#[cfg(not(target_arch = "wasm32"))]
impl From<Icon> for iced_winit::winit::window::Icon {
fn from(icon: Icon) -> Self {
icon.0

View file

@ -21,7 +21,6 @@ impl Default for Position {
}
}
#[cfg(not(target_arch = "wasm32"))]
impl From<Position> for iced_winit::Position {
fn from(position: Position) -> Self {
match position {

View file

@ -47,7 +47,6 @@ impl Default for Settings {
}
}
#[cfg(not(target_arch = "wasm32"))]
impl From<Settings> for iced_winit::settings::Window {
fn from(settings: Settings) -> Self {
Self {