Start iced_winit and iced_wgpu
This commit is contained in:
parent
67d3fe67f3
commit
e1b9d42bf1
22 changed files with 687 additions and 1542 deletions
12
wgpu/Cargo.toml
Normal file
12
wgpu/Cargo.toml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "iced_wgpu"
|
||||
version = "0.1.0-alpha"
|
||||
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
|
||||
edition = "2018"
|
||||
description = "A wgpu renderer for Iced"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/hecrj/iced"
|
||||
|
||||
[dependencies]
|
||||
iced_native = { version = "0.1.0-alpha", path = "../native" }
|
||||
wgpu = "0.3"
|
||||
87
wgpu/src/lib.rs
Normal file
87
wgpu/src/lib.rs
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
use iced_native::{
|
||||
button, checkbox, image, radio, renderer::Debugger, slider, text, Button,
|
||||
Checkbox, Color, Image, Layout, MouseCursor, Node, Point, Radio, Slider,
|
||||
Style, Text,
|
||||
};
|
||||
|
||||
pub struct Renderer;
|
||||
|
||||
impl text::Renderer for Renderer {
|
||||
fn node(&self, _text: &Text) -> Node {
|
||||
Node::new(Style::default())
|
||||
}
|
||||
|
||||
fn draw(&mut self, _text: &Text, _layout: Layout<'_>) {}
|
||||
}
|
||||
|
||||
impl checkbox::Renderer for Renderer {
|
||||
fn node<Message>(&mut self, _checkbox: &Checkbox<Message>) -> Node {
|
||||
Node::new(Style::default())
|
||||
}
|
||||
|
||||
fn draw<Message>(
|
||||
&mut self,
|
||||
_checkbox: &Checkbox<Message>,
|
||||
_layout: Layout<'_>,
|
||||
_cursor_position: Point,
|
||||
) -> MouseCursor {
|
||||
MouseCursor::OutOfBounds
|
||||
}
|
||||
}
|
||||
|
||||
impl radio::Renderer for Renderer {
|
||||
fn node<Message>(&mut self, _checkbox: &Radio<Message>) -> Node {
|
||||
Node::new(Style::default())
|
||||
}
|
||||
|
||||
fn draw<Message>(
|
||||
&mut self,
|
||||
_radio: &Radio<Message>,
|
||||
_layout: Layout<'_>,
|
||||
_cursor_position: Point,
|
||||
) -> MouseCursor {
|
||||
MouseCursor::OutOfBounds
|
||||
}
|
||||
}
|
||||
|
||||
impl slider::Renderer for Renderer {
|
||||
fn node<Message>(&self, _slider: &Slider<Message>) -> Node {
|
||||
Node::new(Style::default())
|
||||
}
|
||||
|
||||
fn draw<Message>(
|
||||
&mut self,
|
||||
_slider: &Slider<Message>,
|
||||
_layout: Layout<'_>,
|
||||
_cursor_position: Point,
|
||||
) -> MouseCursor {
|
||||
MouseCursor::OutOfBounds
|
||||
}
|
||||
}
|
||||
|
||||
impl image::Renderer<&str> for Renderer {
|
||||
fn node(&mut self, _image: &Image<&str>) -> Node {
|
||||
Node::new(Style::default())
|
||||
}
|
||||
|
||||
fn draw(&mut self, _checkbox: &Image<&str>, _layout: Layout<'_>) {}
|
||||
}
|
||||
|
||||
impl button::Renderer for Renderer {
|
||||
fn node<Message>(&self, _button: &Button<Message>) -> Node {
|
||||
Node::new(Style::default())
|
||||
}
|
||||
|
||||
fn draw<Message>(
|
||||
&mut self,
|
||||
_button: &Button<Message>,
|
||||
_layout: Layout<'_>,
|
||||
_cursor_position: Point,
|
||||
) -> MouseCursor {
|
||||
MouseCursor::OutOfBounds
|
||||
}
|
||||
}
|
||||
|
||||
impl Debugger for Renderer {
|
||||
fn explain(&mut self, _layout: &Layout<'_>, _color: Color) {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue