Skip to content

Commit

Permalink
Release 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcristo committed Mar 29, 2023
1 parent fe44070 commit 84fc254
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [Unreleased]
## [0.9.0] - 2023-03-29

### Added

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <david@dtcristo.com>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
43 changes: 21 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<PixelsResource>) {
// 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

Expand Down Expand Up @@ -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.

0 comments on commit 84fc254

Please sign in to comment.