#how do i manually request a struct that implements SystemParam from the world
5 messages · Page 1 of 1 (latest)
how to convert Mut to ResMut ?
note : i am using only bevy ecs and bevy ecs macros crates not all bevy
#[derive(SystemParam)]
pub struct Renderer<'w> {
pub surface: AHResMut<'w, Surface<'static>>,
pub device: AHResMut<'w, wgpu::Device>,
pub queue: AHResMut<'w, wgpu::Queue>,
pub config: AHResMut<'w, wgpu::SurfaceConfiguration>,
pub sizes: AHResMut<'w, Sizes>
}
impl Renderer<'_> {
fn new(world:&mut World) -> Self {
Self{
surface: world.get_resource_mut::<AHState<Surface>>().unwrap()),
// its not returning Mut<Something>, how do i get a ResMut
device: (),
queue: (),
config: (),
sizes: (),
}
}
SystemState is the typical way to get a ResMut directly from a World
I don't believe it's possible to go from Mut to ResMut, as all ResMuts are Mut but not all Mut are ResMut
Why do you need ResMut? Can't you use &mut Something ?