From 3c229ff55b3ba1b618e00fb48f2b350709a58c02 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Tue, 10 Dec 2024 16:06:06 -0500 Subject: Upgraded to Bevy 0.15 --- README.md | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e86ba28..aab28b4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Crates](https://img.shields.io/crates/v/bevy_headless_render)](https://crates.io/crates/bevy_headless_render) ![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg) ![Tag](https://img.shields.io/github/v/tag/exvacuum/bevy_headless_render) -![Build](https://img.shields.io/github/actions/workflow/status/exvacuum/bevy_headless_render/rust.yml) [![Docs](https://img.shields.io/docsrs/bevy_headless_render)](https://exvacuum.github.io/bevy_headless_render) A plugin for the [Bevy](https://bevyengine.org) engine which allows for headless rendering. @@ -15,19 +14,20 @@ Every frame will be copied from `HeadlessRenderSource` render textures into `Hea | Crate Version | Bevy Version | |--- |--- | | 0.1 | 0.14 | +| 0.2 | 0.15 | ## Installation ### crates.io ```toml [dependencies] -bevy_headless_render = "0.1" +bevy_headless_render = "0.2" ``` ### Using git URL in Cargo.toml ```toml [dependencies.bevy_headless_render] -git = "https://github.com/exvacuum/bevy_headless_render.git" +git = "https://git.exvacuum.dev/bevy_headless_render" ``` ## Usage @@ -41,9 +41,6 @@ fn main() { App::new() .add_plugins(( DefaultPlugins - .build() - .disable::(), - ScheduleRunnerPlugin::run_loop(Duration::from_secs_f32(1.0 / TICK_RATE)), bevy_headless_render::HeadlessRenderPlugin, )) .run(); @@ -63,7 +60,7 @@ let mut image = Image { label: None, size, dimension: TextureDimension::D2, - format: TextureFormat::R8Unorm, + format: TextureFormat::Rgba8UnormSrgb, mip_level_count: 1, sample_count: 1, usage: TextureUsages::TEXTURE_BINDING @@ -76,20 +73,15 @@ let mut image = Image { image.resize(size); -let image_handle = images.add(image); // ResMut> +let image_handle = asset_server.add(image); commands.spawn(( - Camera3dBundle { - camera: Camera { - target: image_handle.clone().into(); - ..Default::default() - }, + HeadlessRenderSource::new(&asset_server, image_handle.clone()), + Camera3d::default(), + Camera { + target: image_handle.into(), ..Default::default() }, - bevy_headless_render::HeadlessRenderBundle { - source: headless_render_sources.add(HeadlessRenderSource(image_handle.clone())), // ResMut> - destination: HeadlessRenderDestination::default(), - }, )); ``` -- cgit v1.2.3