diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bbfee1..4e66795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [0.9.0] - 2023-03-29 ### Added @@ -99,7 +99,8 @@ Initial release. -[unreleased]: https://github.com/dtcristo/bevy_pixels/compare/v0.8.0...HEAD +[unreleased]: https://github.com/dtcristo/bevy_pixels/compare/v0.9.0...HEAD +[0.9.0]: https://github.com/dtcristo/bevy_pixels/releases/tag/v0.9.0 [0.8.0]: https://github.com/dtcristo/bevy_pixels/releases/tag/v0.8.0 [0.7.0]: https://github.com/dtcristo/bevy_pixels/releases/tag/v0.7.0 [0.6.0]: https://github.com/dtcristo/bevy_pixels/releases/tag/v0.6.0 diff --git a/Cargo.toml b/Cargo.toml index 0f82888..0640e9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_pixels" description = "Bevy plugin that uses Pixels (a tiny pixel buffer) for rendering" -version = "0.8.0" +version = "0.9.0" authors = ["David Cristofaro "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/README.md b/README.md index 7623696..b525df3 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ Add `bevy` and `bevy_pixels` to `Cargo.toml`. Be sure to disable `bevy`'s `rende ```toml [dependencies] -bevy = { version = "0.9", default_features = false } -bevy_pixels = "0.8" +bevy = { version = "0.10", default_features = false } +bevy_pixels = "0.9" ``` Add `PixelsPlugin` to your Bevy project. @@ -43,34 +43,38 @@ fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugin(PixelsPlugin::default()) - .add_system(main_system) + .add_system(draw.in_set(PixelsSet::Draw)) .run(); } ``` -Use `PixelsResource` in your systems. +Use `PixelsWrapper` in your systems. ```rust -fn main_system(mut pixels_resource: ResMut) { - // Get a mutable slice for the pixel buffer - let frame: &mut [u8] = pixels_resource.pixels.frame_mut(); +fn draw(mut wrapper_query: Query<&mut PixelsWrapper>) { + // Query the `PixelsWrapper` component that owns an instance of `Pixels` for the given window. + let Ok(mut wrapper) = wrapper_query.get_single_mut() else { return }; - // Fill frame with pixel data + // Get a mutable slice for the pixel buffer. + let frame: &mut [u8] = wrapper.pixels.frame_mut(); + + // Fill frame with pixel data. // ... } ``` ## Bevy and Pixels version mapping -| bevy_pixels | bevy | pixels | -| ----------- | ---- | ------ | -| 0.1 | 0.5 | 0.3 | -| 0.2 | 0.5 | 0.8 | -| 0.3-0.4 | 0.6 | 0.9 | -| 0.5 | 0.7 | 0.9 | -| 0.6 | 0.8 | 0.10 | -| 0.7 | 0.9 | 0.10 | -| 0.8 | 0.9 | 0.11 | +| bevy_pixels | bevy | pixels | +| ----------- | ----- | ------ | +| 0.1 | 0.5 | 0.3 | +| 0.2 | 0.5 | 0.8 | +| 0.3-0.4 | 0.6 | 0.9 | +| 0.5 | 0.7 | 0.9 | +| 0.6 | 0.8 | 0.10 | +| 0.7 | 0.9 | 0.10 | +| 0.8 | 0.9 | 0.11 | +| 0.9 | 0.10 | 0.12 | ## Examples @@ -117,8 +121,3 @@ at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions. - -## Todo - -- Add more configuration around how rendering is performed. -- Add support for multiple windows.