This can be useful for running app simulations during integration tests without spawning a window which can be problematic in a testing environment.
struct HeadlessRenderPlugin;
impl Plugin for HeadlessRenderPlugin {
fn build(&self, app: &mut App) {
app.add_plugin(WindowPlugin::default())
.add_plugin(AssetPlugin::default())
.add_plugin(ScenePlugin::default())
.add_plugin(RenderPlugin {
wgpu_settings: WgpuSettings {
backends: None,
..Default::default()
},
})
.add_plugin(ImagePlugin::default());
}
}