Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N53: softbuffer-rgb #1560

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions content/news/053/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,25 @@ There you can also find a [progress overview](https://godot.rapier.rs/docs/progr
[godot_rapier_reddit]: https://www.reddit.com/r/godot/comments/1dtoufn/rewriting_godots_physics_server_in_rust/
[godot]: https://godotengine.org/

### softbuffer-rgb

[softbuffer-rgb](https://crates.io/crates/softbuffer-rgb) is a wrapper around [softbuffer](https://docs.rs/softbuffer/latest/softbuffer/) that makes it easier to modify a raw pixel buffer.

Instead of doing this:

```
buffer.buffer_mut()[y * width + x] = u32::from_le_bytes([0, 200, 70, 10]);
```

...you can now do this:

```
buffer.pixels[y][x] = [0, 200, 70, 10];
```

To put it another way: It rearranges the raw pixel buffer from `[u32; width * height]` into `[[[u8; 4]; width]; height]`


## Popular Workgroup Issues in GitHub

<!-- Up to 10 links to interesting issues -->
Expand Down