diff --git a/src/lib.rs b/src/lib.rs index 9f861fa..c002417 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,7 @@ pub use assets::{ VelloVector, }; pub use debug::DebugVisualizations; +pub use rendertarget::VelloCanvasMaterial; use crate::font::VelloFontLoader; @@ -45,7 +46,7 @@ impl Plugin for BevyVelloPlugin { app.add_asset::() .init_asset_loader::(); app.add_plugins(( - Material2dPlugin::::default(), + Material2dPlugin::::default(), DebugVisualizationsPlugin, )); app.add_systems(Startup, rendertarget::setup_ss_rendertarget) diff --git a/src/rendertarget.rs b/src/rendertarget.rs index 603d2b9..699a755 100644 --- a/src/rendertarget.rs +++ b/src/rendertarget.rs @@ -56,9 +56,9 @@ pub fn setup_image( pub fn resize_rendertargets( mut window_resize_events: EventReader, - mut query: Query<(&mut SSRenderTarget, &Handle)>, + mut query: Query<(&mut SSRenderTarget, &Handle)>, mut images: ResMut>, - mut target_materials: ResMut>, + mut target_materials: ResMut>, windows: Query<&Window>, ) { let Ok(window) = windows.get_single() else { @@ -112,7 +112,7 @@ pub fn setup_ss_rendertarget( mut commands: Commands, mut meshes: ResMut>, mut images: ResMut>, - mut custom_materials: ResMut>, + mut custom_materials: ResMut>, windows: Query<&Window>, // query_vectors: Query>>, mut render_target_mesh_handle: Local>>, @@ -144,7 +144,7 @@ pub fn setup_ss_rendertarget( let texture_image = setup_image(&mut commands, &mut images, &window.resolution); let render_target = SSRenderTarget(texture_image.clone()); let mesh = Mesh2dHandle(mesh_handle.clone()); - let material = custom_materials.add(SSTargetMaterial { + let material = custom_materials.add(VelloCanvasMaterial { texture: texture_image, }); @@ -161,13 +161,13 @@ pub fn setup_ss_rendertarget( #[derive(AsBindGroup, TypeUuid, TypePath, Clone)] #[uuid = "b62bb455-a72c-4b56-87bb-81e0554e234f"] -pub struct SSTargetMaterial { +pub struct VelloCanvasMaterial { #[texture(0)] #[sampler(1)] pub texture: Handle, } -impl Material2d for SSTargetMaterial { +impl Material2d for VelloCanvasMaterial { fn vertex_shader() -> ShaderRef { SSRT_SHADER_HANDLE.typed().into() }