Migrate the bevy example to stageless

This commit is contained in:
Daniel McNab 2023-02-06 15:45:36 +00:00
parent 020a7f5c01
commit 7abbf2ece2
2 changed files with 4 additions and 3 deletions

View file

@ -7,5 +7,5 @@ description = "Example of using Vello in a Bevy application"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
bevy = { git = "https://github.com/bevyengine/bevy", rev = "5d514fb24f2459700f68d8e57d4791bdf5b1b595" } bevy = { git = "https://github.com/bevyengine/bevy", rev = "4fd092fbec07416fa9b1e2306f61231ae20315ac" }
vello = { path = "../../" } vello = { path = "../../" }

View file

@ -1,3 +1,4 @@
use bevy::render::RenderSet;
use vello::kurbo::{Affine, Point, Rect}; use vello::kurbo::{Affine, Point, Rect};
use vello::peniko::{Color, Fill, Gradient, Stroke}; use vello::peniko::{Color, Fill, Gradient, Stroke};
use vello::{Renderer, Scene, SceneBuilder, SceneFragment}; use vello::{Renderer, Scene, SceneBuilder, SceneFragment};
@ -11,7 +12,7 @@ use bevy::{
Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages,
}, },
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
RenderApp, RenderStage, RenderApp,
}, },
}; };
@ -32,7 +33,7 @@ impl Plugin for VelloPlugin {
let Ok(render_app) = app.get_sub_app_mut(RenderApp) else { return }; let Ok(render_app) = app.get_sub_app_mut(RenderApp) else { return };
render_app.init_resource::<VelloRenderer>(); render_app.init_resource::<VelloRenderer>();
// This should probably use the render graph, but working out the dependencies there is awkward // This should probably use the render graph, but working out the dependencies there is awkward
render_app.add_system_to_stage(RenderStage::Render, render_scenes); render_app.add_system(render_scenes.in_set(RenderSet::Render));
} }
} }