-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
Makes the renderer structure consistent. - Introduces `draw_shape` which renderer a widget will employ, rather than being infered by its component, leading to possible dual-rendering and overlap. - Makes the renderer own the resources, and move the Wgpu resources out of the ECS - Improves object uniform updating - Composable renderer system
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
RUST_LOG="info" | ||
RUST_LOG="violet::wgpu::systems=debug,info" | ||
RUST_BACKTRACE=1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
use image::DynamicImage; | ||
Check warning on line 1 in src/shapes.rs GitHub Actions / check
Check warning on line 1 in src/shapes.rs GitHub Actions / check
Check warning on line 1 in src/shapes.rs GitHub Actions / Clippy
Check warning on line 1 in src/shapes.rs GitHub Actions / Clippy
Check warning on line 1 in src/shapes.rs GitHub Actions / test
Check warning on line 1 in src/shapes.rs GitHub Actions / test
Check warning on line 1 in src/shapes.rs GitHub Actions / test_miri
|
||
use palette::Srgba; | ||
use palette::{IntoColor, Srgba}; | ||
Check warning on line 2 in src/shapes.rs GitHub Actions / check
Check warning on line 2 in src/shapes.rs GitHub Actions / check
Check warning on line 2 in src/shapes.rs GitHub Actions / Clippy
Check warning on line 2 in src/shapes.rs GitHub Actions / Clippy
Check warning on line 2 in src/shapes.rs GitHub Actions / test
Check warning on line 2 in src/shapes.rs GitHub Actions / test
Check warning on line 2 in src/shapes.rs GitHub Actions / test_miri
|
||
|
||
use crate::assets::Handle; | ||
Check warning on line 4 in src/shapes.rs GitHub Actions / check
Check warning on line 4 in src/shapes.rs GitHub Actions / check
Check warning on line 4 in src/shapes.rs GitHub Actions / Clippy
Check warning on line 4 in src/shapes.rs GitHub Actions / Clippy
Check warning on line 4 in src/shapes.rs GitHub Actions / test
Check warning on line 4 in src/shapes.rs GitHub Actions / test
Check warning on line 4 in src/shapes.rs GitHub Actions / test_miri
|
||
|
||
/// A rectangle sized to the widget | ||
#[derive(Clone)] | ||
pub struct FilledRect { | ||
pub color: Srgba, | ||
pub fill_image: Option<Handle<DynamicImage>>, | ||
} | ||
|
||
impl std::fmt::Debug for FilledRect { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
f.debug_struct("FilledRect") | ||
.field("color", &self.color) | ||
.field("fill_image", &self.fill_image.as_ref().map(Handle::id)) | ||
.finish() | ||
} | ||
/// Shape to use when drawing a widget | ||
#[derive(Debug, Clone)] | ||
pub enum Shape { | ||
/// The widget will be drawn as a filled rectangle | ||
Rectangle, | ||
} |