macro_rules! asset_plugin {
($(#[$doc:meta])* $name:ident, $gpu_ty:ty) => {
$(#[$doc])*
#[derive(Default)]
pub struct $name;
impl $name {
pub fn new() -> Self {
Self
}
}
impl crate::ecs::plugin::Plugin for $name {
fn build(&self, app: &mut crate::app::App) {
app.add_plugin(crate::assets::plugin::AssetPlugin::<
crate::wgpu::backend::WGPUBackend,
$gpu_ty,
>::new());
}
}
};
}
macro_rules! mipmap_asset_plugin {
($(#[$doc:meta])* $name:ident, $gpu_ty:ty) => {
$(#[$doc])*
#[derive(Default)]
pub struct $name;
impl $name {
pub fn new() -> Self {
Self
}
}
impl crate::ecs::plugin::Plugin for $name {
fn build(&self, app: &mut crate::app::App) {
app.add_plugin(crate::assets::singleton_asset::LazyResourcePlugin::<
crate::wgpu::backend::WGPUBackend,
crate::wgpu::mipmap::MipmapGenerator,
>::new());
app.add_plugin(crate::assets::plugin::AssetPlugin::<
crate::wgpu::backend::WGPUBackend,
$gpu_ty,
>::new());
}
}
};
}
pub(crate) use asset_plugin;
pub(crate) use mipmap_asset_plugin;